Class: QgsProcessingParameterDateTime

class qgis.core.QgsProcessingParameterDateTime

Bases: QgsProcessingParameterDefinition

A datetime (or pure date or time) parameter for processing algorithms.

QgsProcessingParameterDateTime should be evaluated by calling QgsProcessingAlgorithm.parameterAsDateTime(), which will return a date time value.

Added in version 3.14.

QgsProcessingParameterDateTime(name: Optional[str], description: Optional[str] = ‘’, type: Qgis.ProcessingDateTimeParameterDataType = Qgis.ProcessingDateTimeParameterDataType.DateTime, defaultValue: Any = None, optional: bool = False, minValue: Union[QDateTime, datetime.datetime] = QDateTime(), maxValue: Union[QDateTime, datetime.datetime] = QDateTime()) Constructor for QgsProcessingParameterDateTime.

QgsProcessingParameterDateTime(a0: QgsProcessingParameterDateTime)

Enums

Type

alias of ProcessingDateTimeParameterDataType

Methods

asPythonString

param outputType:

checkValueIsAcceptable

param input:

clone

rtype:

Optional[QgsProcessingParameterDefinition]

dataType

Returns the acceptable data type for the parameter.

defaultGuiValueFromSetting

Default gui value for an algorithm parameter from settings

fromScriptCode

Creates a new parameter using the definition from a script code.

fromVariantMap

param map:

maximum

Returns the maximum value acceptable by the parameter.

minimum

Returns the minimum value acceptable by the parameter.

setDataType

Sets the acceptable data type for the parameter.

setMaximum

Sets the maximum value acceptable by the parameter.

setMinimum

Sets the minimum value acceptable by the parameter.

toVariantMap

rtype:

Dict[str, Any]

toolTip

rtype:

str

type

rtype:

str

typeName

Returns the type name for the parameter class.

valueAsPythonString

param value:

Type

alias of ProcessingDateTimeParameterDataType

asPythonString(self, outputType: QgsProcessing.PythonOutputType = QgsProcessing.PythonOutputType.PythonQgsProcessingAlgorithmSubclass) str
Parameters:

outputType (QgsProcessing.PythonOutputType = QgsProcessing.PythonOutputType.PythonQgsProcessingAlgorithmSubclass)

Return type:

str

checkValueIsAcceptable(self, input: Any, context: QgsProcessingContext | None = None) bool
Parameters:
Return type:

bool

clone(self) QgsProcessingParameterDefinition | None
Return type:

Optional[QgsProcessingParameterDefinition]

dataType(self) Qgis.ProcessingDateTimeParameterDataType

Returns the acceptable data type for the parameter.

See also

setDataType()

Return type:

Qgis.ProcessingDateTimeParameterDataType

defaultGuiValueFromSetting(self) Any

Default gui value for an algorithm parameter from settings

Returns:

default value from settings or invalid QVariant if there is no default value defined in the settings

Added in version 3.34.

fromScriptCode(name: str | None, description: str | None, isOptional: bool, definition: str | None) QgsProcessingParameterDateTime | None

Creates a new parameter using the definition from a script code.

Parameters:
  • name (Optional[str])

  • description (Optional[str])

  • isOptional (bool)

  • definition (Optional[str])

Return type:

Optional[QgsProcessingParameterDateTime]

fromVariantMap(self, map: Dict[str, Any]) bool
Parameters:

map (Dict[str)

Return type:

bool

maximum(self) QDateTime

Returns the maximum value acceptable by the parameter.

An invalid QDateTime value indicates no maximum value.

See also

setMaximum()

Return type:

QDateTime

minimum(self) QDateTime

Returns the minimum value acceptable by the parameter.

An invalid QDateTime value indicates no minimum value.

See also

setMinimum()

Return type:

QDateTime

setDataType(self, type: Qgis.ProcessingDateTimeParameterDataType)

Sets the acceptable data type for the parameter.

See also

dataType()

Parameters:

type (Qgis.ProcessingDateTimeParameterDataType)

setMaximum(self, maximum: QDateTime | datetime.datetime)

Sets the maximum value acceptable by the parameter.

An invalid QDateTime value indicates no maximum value.

If the dataType() is QgsProcessingParameterDateTime.Time, then the date component of maximum must be set to any valid date (but this date will not actually be considered when comparing parameter values to the specified maximum value, only the time component will be considered).

See also

maximum()

Parameters:

maximum (Union[QDateTime)

setMinimum(self, minimum: QDateTime | datetime.datetime)

Sets the minimum value acceptable by the parameter.

An invalid QDateTime value indicates no minimum value.

If the dataType() is QgsProcessingParameterDateTime.Time, then the date component of minimum must be set to any valid date (but this date will not actually be considered when comparing parameter values to the specified minimum value, only the time component will be considered).

See also

minimum()

Parameters:

minimum (Union[QDateTime)

toVariantMap(self) Dict[str, Any]
Return type:

Dict[str, Any]

toolTip(self) str
Return type:

str

type(self) str
Return type:

str

typeName() str

Returns the type name for the parameter class.

Return type:

str

valueAsPythonString(self, value: Any, context: QgsProcessingContext) str
Parameters:
Return type:

str