Django / Python and daylight saving time

350 views
Skip to first unread message

Jean-Luc

unread,
Nov 13, 2006, 1:24:42 PM11/13/06
to Django users
It seems Django don't know daylight saving time


my settings.py :
...
# Local time zone for this installation. All choices can be found here:
#
http://www.postgresql.org/docs/current/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
TIME_ZONE = 'Europe/Paris'
...


E:\applis\budget>time
L'heure actuelle est : 19:17:58,31
Entrez la nouvelle heure :

E:\applis\budget>manage.py runserver
Validating models...
0 errors found.

Django version 0.96-pre, using settings 'budget.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
[13/Nov/2006 18:20:03] "GET /budget/2006/08/ HTTP/1.1" 200 35683


It seems to me runserver prints summer time

Has anyone ever notice that ?

Thank you all
jlT

mtbe...@gmail.com

unread,
Nov 14, 2006, 10:50:11 AM11/14/06
to Django users
I dont know why it would use anything other than the system time... Is
the timezone set correctly on your machine?

mynameisgabe

unread,
Nov 14, 2006, 10:54:53 AM11/14/06
to Django users
I've noticed it always prints out GMT time for me, no matter what the
value I use for TIME_ZONE.

For instance, it's set to the default 'America/Chicago' right now. I
put this in my template:

{% now "Y-m-d H:m:s" %}

It returns:

2006-11-14 15:49:52

My time is actually 07:49:52 - it's 8 hours off which makes sense
because I'm in PST (-08:00). What am I doing wrong?

thx

Gabe

mtbe...@gmail.com

unread,
Nov 14, 2006, 12:02:12 PM11/14/06
to Django users
Your system clock is probably wrong also. Mine works fine.

mynameisgabe

unread,
Nov 14, 2006, 1:16:19 PM11/14/06
to Django users
On Nov 14, 9:02 am, "mtbee...@gmail.com" <mtbee...@gmail.com> wrote:
> Your system clock is probably wrong also. Mine works fine.

My system clock claims it's on the right time. That's what I'm using
in the above example - 07:49:52 came from the clock in the windows task
bar. However, Django always says it's GMT, no matter what timezone I
set in the settings.py file. It happens on my home computer and my
work computer. Both computers are running python 2.4.4 . One is
running django from the trunk, the other from 0.95.

g

James Bennett

unread,
Nov 14, 2006, 1:56:54 PM11/14/06
to django...@googlegroups.com
On 11/14/06, mynameisgabe <myname...@gmail.com> wrote:
> My system clock claims it's on the right time. That's what I'm using
> in the above example - 07:49:52 came from the clock in the windows task
> bar.

I remember a while back there was a spate of problems with correctly
setting the time-zone environment variable on Windows; I'll dig a bit
through old tickets tonight and see if I can find anything relevant.


--
"May the forces of evil become confused on the way to your house."
-- George Carlin

Jean-Luc

unread,
Nov 14, 2006, 2:08:23 PM11/14/06
to Django users
mtbe...@gmail.com a écrit :

> I dont know why it would use anything other than the system time... Is
> the timezone set correctly on your machine?

time is a DOS command
and it renders the good time, same time i can show under Windows

but Django runserver renders summer time, or GMT ?

Thanks all
jlT

Waylan Limberg

unread,
Nov 14, 2006, 2:16:14 PM11/14/06
to django...@googlegroups.com
I believe #2315 is the ticket your looking for. It is windows
specific. Be sure to read through the comments to the end.

http://code.djangoproject.com/ticket/2315


--
----
Waylan Limberg
way...@gmail.com

SmileyChris

unread,
Nov 14, 2006, 2:32:02 PM11/14/06
to Django users
The problem is specifically with the development server. Add "import
time" to django/conf/__init__.py and see if it fixes it for you.

Please report if that solves your problem in the above mentioned ticket
(http://code.djangoproject.com/ticket/2315) - if multiple people have
tested and can confirm the fix, it's more likely to get applied.

Reply all
Reply to author
Forward
0 new messages