time problem in django, maybe related to daylight savings time adjustment

341 views
Skip to first unread message

Zhou Heng

unread,
Oct 4, 2013, 8:52:56 PM10/4/13
to django...@googlegroups.com
Please look at the image below:

The time in django is one hour later than the actual time (18:43 vs 19.43). I guess it may be because django forgot to hangle daylight savings time adjustment. How to fix this problem (so that django can adjust DST automatically, not manually after a few months when DST is not in effect in EDT time zone)? Thank you!

Russell Keith-Magee

unread,
Oct 5, 2013, 8:33:28 PM10/5/13
to Django Users

Django isn't doing anything sophisticated here -- it's just printing the result of Python's datetime.now(). Do you get the same result if you start a python shell and run: 

from datetime import datetime
print datetime.now()

If you do, the problem is at the python level, not the Django level.

One possible option -- Are you using pytz, and if so, have you got an up-to-date timezone database?

Yours,
Russ Magee %-)

--
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/250f6c5c-94db-4a3a-b0d0-0d44f008a3cd%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages