Millisecond timestamp function?

Joshua J. Kugler joshua at eeinternet.com
Fri Oct 19 19:15:16 CEST 2007


On Friday 19 October 2007 05:44, Dmitri O.Kondratiev wrote:

> What Python module / function can be used to get millisecond timestamps?
> time.time() returns the time as a floating point number expressed in
> seconds since the epoch, in UTC.
> 
> Thanks!

See the module datetime.

The datetime object can return down the to microsecond.

>>> import datetime
>>> datetime.datetime.now()
datetime.datetime(2007, 10, 19, 9, 13, 53, 289075)

j

-- 
Joshua Kugler
Lead System Admin -- Senior Programmer
http://www.eeinternet.com
PGP Key: http://pgp.mit.edu/  ID 0xDB26D7CE




More information about the Python-list mailing list