need to print seconds from the epoch including the millisecond

Dave Angel davea at davea.name
Fri Dec 27 05:54:41 CET 2013


On Thu, 26 Dec 2013 20:03:34 -0500, Terry Reedy <tjreedy at udel.edu> 
wrote:
> On 12/26/2013 5:48 PM, Dave Angel wrote:
> > You're probably on Windows,  which does time differently.

> With 3.3 and 3.4 on Windows 7, time.time() gives 6 fractional 
digits.
>  >>> import time; time.time()
> 1388105935.971099

> With 2.7, same machine, I only get 3.

The way I recall it,  Windows time is a mess. To get better than 10 
ms resolution you needed to use time.clock, but that isn't epoch 
time. Trickier solutions existed, depending on exactly what the 
problem was. But judging from your test, 3.3 built those gyrations 
into the stdlib. I dunno,  I pretty much stopped using Windows 4 
years ago.

-- 
DaveA




More information about the Python-list mailing list