[Django]-Django DateTimeField with UTC offset?


When you set USE_TZ = True in your settings, Django stores date and time information in UTC in the database otherwise it will store naive date time (date time without timezone).

In most cases using Django’s time zones support is very convenient because input and output datetime will be automatically translate by Django.

But if you really need timezone input from your user, you will need to set USE_TZ = False then use DateTimeField which is naive datetime along with CharField to store timezone information in your models.py.

ref: https://docs.djangoproject.com/en/2.1/topics/i18n/timezones/

Leave a comment