timezone stuff driving me bonkers!!!

M.-A. Lemburg mal at lemburg.com
Thu Apr 15 11:49:17 EDT 1999


Stephen Crompton wrote:
> 
> Pretty obvious from the header I guess.
> 
> I want to convert from a UTC tuple to the time since the epoch. As far
> as I can tell this should definitely be timezone, DST, etc. independent.
> However, there is a notable absence of this functionality in the time
> module (presumably due to C library absences ?)

Try the utc2local() function in mxDateTime (an extension package
which can download from my Python Pages).

It will convert a DateTime instance using UTC values to a
DateTime instance using local time. The .ticks() method on
that instance will get you the time since epoch value.

Cheers,
-- 
Marc-Andre Lemburg                               Y2000: 260 days left
---------------------------------------------------------------------
          : Python Pages >>> http://starship.skyport.net/~lemburg/  :
           ---------------------------------------------------------





More information about the Python-list mailing list