Django Datetime and timezone programming ¶ See also https://github.com/django/django/blob/master/django/db/models/functions/datetime.py https://docs.djangoproject.com/en/dev/ref/models/fields/#datetimefield Datetime articles Datetime articles 2019 Datetime articles 2019-10 Django Datetime settings ( from django.conf import settings ) from django.conf import settings DATETIME_INPUT_FORMATS TIME_ZONE Note Django Timezone Overview Example Django models Models DateTime field Models DateTimeField Models Duration field DurationField Example django.utils.parse_duration Models DurationField django/db/models/fields/__init__.py Django querysets querysets datetimes querysets date (For datetime fields, casts the value as date ) date Django forms Forms DateTime field DateTimeField DateTimeInput django/forms/widgets/datetime.html django/forms/widgets/input.html django/forms/widgets/attrs.html ISODateTimeField Django forms durationfield Tests Django datetime formatting Format i18n Django DateTime Overview Template timezone formatting ( timezone ) tz (time-zones-in-templates) Django utils dateparse.py + tests_dateparse.py django.utils.dateparse.py django.utils.dateparse.py django.utils.dateparse.parse_duration django.utils.dateparse.parse_datetime tests/utils_tests/test_dateparse.py tests/utils_tests/test_dateparse.py class DurationParseTests(unittest.TestCase)