Hello,

I'm new to Python and Django so please bear with me on this one.

I've been reading the Django docs, googling, and searching this mailing 
list on the proper configuration and usage of Django when USE_TZ = True. 
However, I'm still a bit fuzzy on things and would like clarification on 
the following:


   1. The documentation says that when USE_TZ = True that "Django stores 
   datetime information in UTC in the database, uses time-zone-aware datetime 
   objects internally, and translates them to the end user’s time zone in 
   templates and forms." Does this mean that the TIME_ZONE setting in 
   settings.py should be UTC? Or should it be the timezone in which the 
   database server is located?
   2. I am using a postgresql database, and the installation defaulted the 
   database's timezone to my local one. In support of Django storing all 
   datetime information in UTC in the database, does the database's timezone 
   needs to be set to UTC? Or is it correct for the database's timezone to be 
   the local one?
   3. The documentation also says that one should use the UTC timezone in 
   the code, and only convert to local time when dealing with end users. I 
   take this to mean that in any code I write I should set tzinfo = UTC for 
   all datetime objects I create programmatically and let Django translate 
   them in forms and views to the end user's timezone automatically. Is this 
   correct?

Thank you in advance for the help,

-Ryan Causey

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b37291e8-3d99-49a4-8e9a-13a6639ef29b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to