mktime() like function to produce GMT?

M.-A. Lemburg mal at lemburg.com
Fri Apr 30 10:04:05 EDT 1999


Mark Nottingham wrote:
> 
> I need a function to produce a Unix epoch time from a time tuple, a la
> time.mktime(). Problem is, mktime() gives you the tuple in localtime, which
> is dangerous if you're dealing with GMT times in the past (like in the
> HTTP).
> 
> Is there a function that will make a GMT epoch time straight from a time
> tuple?

On some platforms there is gmtime() which does exactly this.

It's available through mxDateTime, BTW, which also offers a
work-around solution for those platforms where it is not
available. See the Python Pages below.

-- 
Marc-Andre Lemburg                               Y2000: 245 days left
---------------------------------------------------------------------
          : Python Pages >>> http://starship.python.net/~lemburg/  :
           ---------------------------------------------------------





More information about the Python-list mailing list