Re: timelocal (more specific)

Tim Peters (tim@ksr.com)
Mon, 28 Feb 94 18:26:07 EST

> In an earlier post I asked if anyone had added the timelocal function to
> timemodule.c. I am _not_ refering to localtime. I mean the function
> to which one can pass a list like the one returned by localtime and
> have it return the time, in seconds, since the epoch. ...

Have you looked at time.mktime()? Best I can make out, that's what
you're asking for:

mktime
This is the inverse function of localtime. Its argument is the full
9-tuple (since the dst flag is needed). It returns an integer.

>>> import time
>>> time.time()
762477766.033
>>> time.localtime(time.time())
(1994, 2, 28, 18, 22, 48, 0, 59, 0)
>>> time.mktime(time.localtime(time.time()))
762477771
>>>

from-which-you-can-infer-my-typing-speed<grin>-ly y'rs - tim

Tim Peters tim@ksr.com
not speaking for Kendall Square Research Corp