Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > time.strftime Timezone issue

Reply
Thread Tools

time.strftime Timezone issue

 
 
Allen Unueco
Guest
Posts: n/a
 
      06-12-2004
I feel that the '%Z' format specifier from strftime() returns the wrong
value when daylight savings is in effect.

Today the following is always true:
time.strftime('%Z') == time.tzname[0]

Shouldn't it be:
time.strftime('%Z') == time.tzname[time.daylight]

-allen
 
Reply With Quote
 
 
 
 
Allen Unueco
Guest
Posts: n/a
 
      06-13-2004
Never mind,

I just looked at Modules/timemodule.c and now I realize it that
time.strftime() is just a wrapper for the c library function of the same
name.

I guess I'll just live with my 'time.tzname[time.daylight]' code.

-allen


Allen Unueco wrote:
> I feel that the '%Z' format specifier from strftime() returns the wrong
> value when daylight savings is in effect.
>
> Today the following is always true:
> time.strftime('%Z') == time.tzname[0]
>
> Shouldn't it be:
> time.strftime('%Z') == time.tzname[time.daylight]
>
> -allen

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
TimeZone change - how to use TimeZone class axrock Java 8 03-25-2009 11:54 PM
TimeZone calculation on Windows Vista with DateTime::TimeZone Ami Perl Misc 5 09-24-2007 07:27 AM
Convert windows TimeZone to Java TimeZone asaf Java 3 09-11-2006 05:40 PM
RE: time.strftime Timezone issue Tim Peters Python 0 06-13-2004 05:55 AM
RE: time.strftime Timezone issue Tim Peters Python 1 06-13-2004 04:08 AM



Advertisments