[Zope] Getting the epoch time as an integer

J C Lawrence claw@kanga.nu
Sun, 23 Jan 2000 23:18:47 -0800


On Mon, 24 Jan 2000 18:08:32 +1100 
Anthony Baxter <anthony@interlink.com.au> wrote:

>>>> J C Lawrence wrote
>> How do I get the current time as the number of seconds since the
>> Epoch?

> ZopeTime().timeTime()

This appear to return a floating point value (as you mentioned),
where the fractional part attempts to track the high resolution
timer out to three digits (not quite the nanoseconds of the high res
timer that).  The integer part of:

  ZopeTime().timeTime()

is identical to that returned by:

  _.int(ZopeTime()).

Curious.  More grist for the HOW-TO.

> from the canonical source:

>     def timeTime(self): """Return the date/time as a
> floating-point number in UTC, in the format used by the python
> time module.  Note that it is possible to create date/time values
> with DateTime that have no meaningful value to the time module."""
> return self._t

Thanks.

-- 
J C Lawrence                                 Home: claw@kanga.nu
----------(*)                              Other: coder@kanga.nu
--=| A man is as sane as he is dangerous to his environment |=--