#7209 closed (worksforme)
time_zone conflict.. datetime.now() (in django shell) shows 3 hours earlier
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Core (Other) | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
to make it clear, I replicate the problem:
[02:29] (tunix@penguix raptiye)$ date Cts May 10 02:31:57 EEST 2008
[02:31] (tunix@penguix raptiye)$ python Python 2.5.2 (r252:60911, Feb 23 2008, 21:20:32) [GCC 4.2.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from datetime import datetime >>> datetime.now() datetime.datetime(2008, 5, 10, 2, 32, 7, 410947) >>> datetime.utcnow() datetime.datetime(2008, 5, 9, 23, 32, 10, 255636) >>>
[02:32] (tunix@penguix raptiye)$ ./manage.py shell Python 2.5.2 (r252:60911, Feb 23 2008, 21:20:32) [GCC 4.2.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> from datetime import datetime >>> datetime.now() datetime.datetime(2008, 5, 9, 23, 32, 25, 624929) >>> datetime.utcnow() datetime.datetime(2008, 5, 9, 23, 32, 29, 45600) >>>
i've just set system time to UTC and it still doesn't work.. i'm using Europe/Istanbul as the timezone.. django would work fine a few weeks before..
Change History (5)
comment:1 by , 17 years ago
comment:2 by , 17 years ago
Description: | modified (diff) |
---|
comment:3 by , 16 years ago
Component: | Uncategorized → Core framework |
---|---|
milestone: | → 1.0 |
Triage Stage: | Unreviewed → Accepted |
Seems like a bug.
comment:4 by , 16 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
The behavior reported by Colin Grady is associated with an unknown TIME_ZONE. America/Pacific isn't on the list at http://en.wikipedia.org/wiki/List_of_tz_zones_by_name. Unknown time zones cause the time zone to default to UTC.
Since Europe/Istanbul as listed in the original ticket is a valid time zone, I'm not sure what's up. Could be as simple as a misspelling in settings.py.
Otherwise, with a time zone that I know is valid, this worksforme.
I am also seeing strange behavior:
With the first
TIME_ZONE
setting, it seemed it might be respecting it, but changing to anything for Pacific time made it switch to UTC inmanage.py shell