Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django application using UTC throughout

I am building a Django application that will be using UTC for all time stamps and datetime fields. The users (operators of a networks of environmental research stations) are trained to enter times in UTC (GMT) and the server as well as the users' work desktop/laptop computers are set to UTC with no daylight saving time adjustment.

In settings.py, I could set TIME_ZONE to None, but do not want to rely on server time if I can help it.

How would you set Django's configuration settings?

like image 618
chryss Avatar asked Feb 21 '26 08:02

chryss


1 Answers

I could be wrong on this (I've only partially updated a project to correctly handle timezones), but I believe that the TIME_ZONE variable is only used by the Postgres backend (determined by grepping the source). So, if you're not using Postgres, it doesn't really matter what you use… And if you are using Postgres, you can use "UTC" (relevant documentation).

like image 108
David Wolever Avatar answered Feb 22 '26 22:02

David Wolever



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!