Class: QgsProcessingParameterDateTime¶
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.
Class Hierarchy¶
Base classes¶
| Base class for the definition of processing parameters. | 
Enums
| alias of  | 
Methods
| Returns the acceptable data type for the parameter. | |
| Returns the maximum value acceptable by the parameter. | |
| Returns the minimum value acceptable by the parameter. | |
| Sets the acceptable data type for the parameter. | |
| Sets the maximum value acceptable by the parameter. | |
| Sets the minimum value acceptable by the parameter. | 
Static Methods
| Creates a new parameter using the definition from a script code. | |
| Returns the type name for the parameter class. | 
- class qgis.core.QgsProcessingParameterDateTime[source]¶
- Bases: - QgsProcessingParameterDefinition- __init__(name: str | None, description: str | None = '', type: Qgis.ProcessingDateTimeParameterDataType = Qgis.ProcessingDateTimeParameterDataType.DateTime, defaultValue: Any = None, optional: bool = False, minValue: QDateTime | datetime.datetime = QDateTime(), maxValue: QDateTime | datetime.datetime = QDateTime())
- Constructor for QgsProcessingParameterDateTime. - Parameters:
- 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()) 
 
 
 - __init__(a0: QgsProcessingParameterDateTime)
- Parameters:
 
 - Type¶
- alias of - ProcessingDateTimeParameterDataType
 - dataType(self) Qgis.ProcessingDateTimeParameterDataType[source]¶
- Returns the acceptable data type for the parameter. - See also - Return type:
 
 - static fromScriptCode(name: str | None, description: str | None, isOptional: bool, definition: str | None) QgsProcessingParameterDateTime | None[source]¶
- 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] 
 
 - maximum(self) QDateTime[source]¶
- Returns the maximum value acceptable by the parameter. - An invalid QDateTime value indicates no maximum value. - See also - Return type:
- QDateTime 
 
 - minimum(self) QDateTime[source]¶
- Returns the minimum value acceptable by the parameter. - An invalid QDateTime value indicates no minimum value. - See also - Return type:
- QDateTime 
 
 - setDataType(self, type: Qgis.ProcessingDateTimeParameterDataType)[source]¶
- Sets the acceptable data - typefor the parameter.- See also - Parameters:
 
 - setMaximum(self, maximum: QDateTime | datetime.datetime)[source]¶
- Sets the - maximumvalue acceptable by the parameter.- An invalid QDateTime value indicates no maximum value. - If the - dataType()is QgsProcessingParameterDateTime.Time, then the date component of- maximummust 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 - Parameters:
- maximum (Union[QDateTime, datetime.datetime]) 
 
 - setMinimum(self, minimum: QDateTime | datetime.datetime)[source]¶
- Sets the - minimumvalue acceptable by the parameter.- An invalid QDateTime value indicates no minimum value. - If the - dataType()is QgsProcessingParameterDateTime.Time, then the date component of- minimummust 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 - Parameters:
- minimum (Union[QDateTime, datetime.datetime])