The DateTime Field is meant for displaying dates with an specific format (in case you don't want to use timestamps). The transform_data method of this field, turns the data into a more readable format specified by the user through the format parameter.
As a difference from the Date Field, DateTime Field is capable of changing the DateTime time zone easing the process of localization.
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
format | Union[str] | '%Y-%m-%d' | False | Format for the field. |
timezone | Union[str, None] | - | False | Timezone for the field. |
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
type | DynamicFieldType | DATE | True | Type of the dynamic field. |
DateTimeField(field='data.launch_time', format='%Y-%m-%d %H:%M', timezone='etc/GMT+6')
Known Issues
Parsed string dates with attached time zones may behave unpredictably, as the date time is interpreted backwards by the string date parser, an example of faulty date is "2012-01-19 19:21:00 GMT+2"