Time value standard for extension modules?
M.-A. Lemburg
mal at lemburg.com
Tue May 25 17:13:17 EDT 1999
Jim Meier wrote:
>
> I'm cleaning up the event interface in my recently released GGIwrapper,
> and am considering how the event timestamp should be returned. The value
> is stored as a standard struct timeval.
>
> I would like for this value to be easily compatible with other time
> values in python, but can't seem to find much documentation on what is
> normally used. (maybe I'm not looking in the right places(the library
> docs)?)
>
> Should it be an integer value in microseconds, a floating point value in
> seconds, a structure with separate attributes for seconds and
> microseconds, or something else?
The C libs standard is seconds since the epoch (1.1.1970). Python
returns this as floating point value with precision depending on
the accuracy of the underlying C lib.
Other possibilities are: COM dates, Julian Day Numbers, etc.
A Python extension wrapping all these things into nice Python
objects can be found here:
http://starship.skyport.net/~lemburg/mxDateTime.html
--
Marc-Andre Lemburg
______________________________________________________________________
Y2000: 220 days left
Business: http://www.lemburg.com/
Python Pages: http://www.lemburg.com/python/
More information about the Python-list
mailing list