Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > different time tuple format

Reply
Thread Tools

different time tuple format

 
 
Magnus Lycka
Guest
Posts: n/a
 
      06-10-2005
Maksim Kasimov wrote:
> hi all, sorry if i'm reposting
>
> why time.strptime and time.localtime returns tuple with different DST (9
> item of the tuple)?


I've been bitten by the quirks in the time modules so many times
that I would advice against using it for any date handling. It's
ok for time measurement as long as you understand the differences
between time.clock and time.time on your particular platform. You
should be aware that it's just a thin wrapper around the c libs,
and they seem to disagree wildly among platforms on how things
should be done. On NT 4 for instance, the C time libs was a few
weeks off concerning when DST starts in Europe (but the win32 API
was correct), time zone names vary among platforms etc. There is
an inverse of localtime() in mktime(), but no inverse of gmtime()
etc. Yuk!

I would suggest that you either update Python to 2.4 (or 2.3) and
use the datetime module, or that you get mxDateTime if you are
stuck with 2.2.
 
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
*tuple vs tuple example print os.path.join(os.path.dirname(os.tmpnam()),*("a","b","c")) Steve Python 1 12-13-2005 10:25 PM
Why tuple with one item is no tuple Gregor Horvath Python 37 03-30-2005 06:58 AM
Easily convert unicode tuple to python string tuple??? Michal Mikolajczyk Python 1 04-20-2004 08:37 PM
Re: Easily convert unicode tuple to python string tuple??? Jeff Epler Python 0 04-20-2004 03:36 PM
Re: Easily convert unicode tuple to python string tuple??? Bill Scherer Python 0 04-20-2004 03:34 PM



Advertisments