Re: need to print seconds from the epoch including the millisecond

2014-01-03 Thread Grant Edwards
On 2014-01-03, Dave Angel wrote: > On Thu, 2 Jan 2014 16:23:22 + (UTC), Grant Edwards > wrote: >> AFAIK, that's irrelevent. time.time() returns a float. On all the >> CPython implementations I know of, that is a 64-bit IEEE format, >> which provides 16 decimal digits of precision regardles

Re: need to print seconds from the epoch including the millisecond

2014-01-03 Thread Chris Angelico
On Sat, Jan 4, 2014 at 2:33 AM, Grant Edwards wrote: > time.time() returns a Python float. A Python float will have 16 digits > of precision. Perhaps the OS always sets some of those digits to 0 (or > even random values), but they're still there. Perhaps the accuracy or > granularity of the value

Re: need to print seconds from the epoch including the millisecond

2014-01-02 Thread Dave Angel
On Thu, 2 Jan 2014 16:23:22 + (UTC), Grant Edwards wrote: AFAIK, that's irrelevent. time.time() returns a float. On all the CPython implementations I know of, that is a 64-bit IEEE format, which provides 16 decimal digits of precision regardless of the granularity of the system time va

Re: need to print seconds from the epoch including the millisecond

2014-01-02 Thread Grant Edwards
On 2013-12-26, Steven D'Aprano wrote: > matt.doolittl...@gmail.com wrote: > >> On Thursday, December 26, 2013 2:22:10 PM UTC-5, Dan Stromberg wrote: >>> On Thu, Dec 26, 2013 at 10:32 AM, wrote: >>> >>> > i am using 2.7. I need to print the time in seconds from the epoch >>> > with millisecond

Re: need to print seconds from the epoch including the millisecond

2013-12-30 Thread Steven D'Aprano
Mark Lawrence wrote: > On 30/12/2013 17:07, Cousin Stanley wrote: [...] >>> Would you please read and action this >>> https://wiki.python.org/moin/GoogleGroupsPython >>> to prevent us seeing the double line spacing above, thanks. >> >> You might consider either turning off an option >> in your ne

Re: need to print seconds from the epoch including the millisecond

2013-12-30 Thread Cousin Stanley
>> You might consider either turning off an option >> in your news client for including message in reply >> and/or snipping all but a few lines for context >> to prevent us from seeing the double line spacing >> all over again :-) > Great idea, but one slight snag is > the poster then does

Re: need to print seconds from the epoch including the millisecond

2013-12-30 Thread Mark Lawrence
On 30/12/2013 17:07, Cousin Stanley wrote: On 30/12/2013 12:16, matt.doolittl...@gmail.com wrote: thanks a bunch. the "%.6f" was the cure. can you please point me to the doc for formatting time? Thanks! Would you please read and action this https://wiki.python.org/moin/GoogleGroupsP

Re: need to print seconds from the epoch including the millisecond

2013-12-30 Thread Cousin Stanley
>> On 30/12/2013 12:16, matt.doolittl...@gmail.com wrote: >> >> >> thanks a bunch. the "%.6f" was the cure. >> can you please point me to the doc for formatting time? >> Thanks! >> > Would you please read and action this > https://wiki.python.org/moin/GoogleGroupsPython > to prevent

Re: need to print seconds from the epoch including the millisecond

2013-12-30 Thread Roy Smith
In article , Ned Batchelder wrote: > A float's str() includes two decimal points of precision It's actually weirder than that. What str() appears to do is print some variable number of digits after the decimal place, depending on the magnitude of the number, and then flips over to exponentia

Re: need to print seconds from the epoch including the millisecond

2013-12-30 Thread Mark Lawrence
On 30/12/2013 12:16, matt.doolittl...@gmail.com wrote: On Friday, December 27, 2013 1:49:54 PM UTC-5, Ned Batchelder wrote: On 12/27/13 1:09 PM, matt.doolittl...@gmail.com wrote: On Friday, December 27, 2013 11:27:58 AM UTC-5, Roy Smith wrote: In article <0c33b7e4-edc9-4e1e-b919-fec210c92..

Re: need to print seconds from the epoch including the millisecond

2013-12-30 Thread matt . doolittle33
On Monday, December 30, 2013 8:01:21 AM UTC-5, Ned Batchelder wrote: > On 12/30/13 7:50 AM, Ned Batchelder wrote: > > > BTW, I said something very similar in this thread 2.5 days ago: > > > https://mail.python.org/pipermail/python-list/2013-December/663454.html > > > I get the feeling not all me

Re: need to print seconds from the epoch including the millisecond

2013-12-30 Thread Ned Batchelder
On 12/30/13 7:50 AM, Ned Batchelder wrote: BTW, I said something very similar in this thread 2.5 days ago: https://mail.python.org/pipermail/python-list/2013-December/663454.html I get the feeling not all messages are flowing to all places. Oops, and now Matt's reply to that message has just ar

Re: need to print seconds from the epoch including the millisecond

2013-12-30 Thread Ned Batchelder
On 12/29/13 9:44 PM, matt.doolittl...@gmail.com wrote: On Friday, December 27, 2013 7:25:42 PM UTC-5, Cameron Simpson wrote: On 27Dec2013 07:40, matt.doolittl...@gmail.com wrote: I am on Ubuntu 12.10. I am still working with the 2 decimal places. Sometime ago i had this issue and I forg

Re: need to print seconds from the epoch including the millisecond

2013-12-30 Thread matt . doolittle33
On Friday, December 27, 2013 1:49:54 PM UTC-5, Ned Batchelder wrote: > On 12/27/13 1:09 PM, matt.doolittl...@gmail.com wrote: > > > On Friday, December 27, 2013 11:27:58 AM UTC-5, Roy Smith wrote: > > >> In article <0c33b7e4-edc9-4e1e-b919-fec210c92...@googlegroups.com>, > > >> > > >> matt.do

Re: need to print seconds from the epoch including the millisecond

2013-12-30 Thread matt . doolittle33
On Friday, December 27, 2013 7:25:42 PM UTC-5, Cameron Simpson wrote: > On 27Dec2013 07:40, matt.doolittl...@gmail.com > wrote: > > > I am on Ubuntu 12.10. I am still working with the 2 decimal > > > places. Sometime ago i had this issue and I forget how i solved it. > > > maybe i used datet

Re: need to print seconds from the epoch including the millisecond

2013-12-27 Thread Steven D'Aprano
On Fri, 27 Dec 2013 21:10:49 -0500, Ned Batchelder wrote: > On 12/27/13 7:25 PM, Cameron Simpson wrote: >> On 27Dec2013 07:40, matt.doolittl...@gmail.com >> wrote: >>> I am on Ubuntu 12.10. I am still working with the 2 decimal places. >>> Sometime ago i had this issue and I forget how i solved

Re: need to print seconds from the epoch including the millisecond

2013-12-27 Thread Ned Batchelder
On 12/27/13 7:25 PM, Cameron Simpson wrote: On 27Dec2013 07:40, matt.doolittl...@gmail.com wrote: I am on Ubuntu 12.10. I am still working with the 2 decimal places. Sometime ago i had this issue and I forget how i solved it. maybe i used datetime? thanks! Repeatedly people have asked you

Re: need to print seconds from the epoch including the millisecond

2013-12-27 Thread Roy Smith
matt.doolittl...@gmail.com wrote: > I need to print the time in seconds from the epoch with > millisecond precision. I wrote: > What happens if you do: > > t = time.time() > self.logfile.write("str=%s, repr=%s", (str(t), repr(t))) At the time I originally posted that, I was baffled as to wha

Re: need to print seconds from the epoch including the millisecond

2013-12-27 Thread Cameron Simpson
On 27Dec2013 07:40, matt.doolittl...@gmail.com wrote: > I am on Ubuntu 12.10. I am still working with the 2 decimal > places. Sometime ago i had this issue and I forget how i solved it. > maybe i used datetime? thanks! Repeatedly people have asked you to show your exact code. Still nothing. H

Re: need to print seconds from the epoch including the millisecond

2013-12-27 Thread Roy Smith
In article , Roy Smith wrote: > self.logfile.write("str=%s, repr=%s", (str(t), repr(t))) Ugh, make that: > self.logfile.write("str=%s, repr=%s" % ((str(t), repr(t))) -- https://mail.python.org/mailman/listinfo/python-list

Re: need to print seconds from the epoch including the millisecond

2013-12-27 Thread Roy Smith
In article <1db0d993-9d2d-46af-9ee8-69d9250dc...@googlegroups.com>, matt.doolittl...@gmail.com wrote: > > Please post the *exact* code you're running. The code you posted > > earlier is obviously only a fragment of some larger program, so we can > > only guess what's happening. Assuming your

Re: need to print seconds from the epoch including the millisecond

2013-12-27 Thread Ned Batchelder
On 12/27/13 1:09 PM, matt.doolittl...@gmail.com wrote: On Friday, December 27, 2013 11:27:58 AM UTC-5, Roy Smith wrote: In article <0c33b7e4-edc9-4e1e-b919-fec210c92...@googlegroups.com>, matt.doolittl...@gmail.com wrote: I am on Ubuntu 12.10. I am still working with the 2 decimal place

Re: need to print seconds from the epoch including the millisecond

2013-12-27 Thread matt . doolittle33
On Friday, December 27, 2013 11:27:58 AM UTC-5, Roy Smith wrote: > In article <0c33b7e4-edc9-4e1e-b919-fec210c92...@googlegroups.com>, > > matt.doolittl...@gmail.com wrote: > > > > > I am on Ubuntu 12.10. I am still working with the 2 decimal places. > > > Sometime ago i had this issue and

Re: need to print seconds from the epoch including the millisecond

2013-12-27 Thread Roy Smith
In article <0c33b7e4-edc9-4e1e-b919-fec210c92...@googlegroups.com>, matt.doolittl...@gmail.com wrote: > I am on Ubuntu 12.10. I am still working with the 2 decimal places. > Sometime ago i had this issue and I forget how i solved it. maybe i used > datetime? thanks! That's strange. Linux

Re: need to print seconds from the epoch including the millisecond

2013-12-27 Thread Dave Angel
On Fri, 27 Dec 2013 07:40:29 -0800 (PST), matt.doolittl...@gmail.com wrote: I am on Ubuntu 12.10. I am still working with the 2 decimal places. Sometime ago i had this issue and I forget how i solved it. maybe i used datetime? thanks! Now I'm stumped. 2.7.3 on Ubuntu 12.04 and time.time giv

Re: need to print seconds from the epoch including the millisecond

2013-12-27 Thread matt . doolittle33
On Thursday, December 26, 2013 11:54:41 PM UTC-5, Dave Angel wrote: > On Thu, 26 Dec 2013 20:03:34 -0500, Terry Reedy > > 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.tim

Re: need to print seconds from the epoch including the millisecond

2013-12-27 Thread matt . doolittle33
I pretty much stopped using Windows 4 > > years ago. > I got off the plantation over a year ago and have not looked back. -- https://mail.python.org/mailman/listinfo/python-list

Re: need to print seconds from the epoch including the millisecond

2013-12-27 Thread matt . doolittle33
On Thursday, December 26, 2013 8:29:15 PM UTC-5, Roy Smith wrote: > In article <59aa73ac-e06e-4c0e-83a4-147ac42ca...@googlegroups.com>, > > matt.doolittl...@gmail.com wrote: > > > > > > In [1]: import time > > > > In [2]: time.time() > > > > Out[2]: 1388085670.1567955 > > > > > > OK i did

Re: need to print seconds from the epoch including the millisecond

2013-12-26 Thread Dave Angel
On Thu, 26 Dec 2013 20:03:34 -0500, Terry Reedy 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

Re: need to print seconds from the epoch including the millisecond

2013-12-26 Thread Roy Smith
In article <59aa73ac-e06e-4c0e-83a4-147ac42ca...@googlegroups.com>, matt.doolittl...@gmail.com wrote: > > In [1]: import time > > In [2]: time.time() > > Out[2]: 1388085670.1567955 > > OK i did what you said but I am only getting 2 decimal places. > Why is this and what can I do to get the mil

Re: need to print seconds from the epoch including the millisecond

2013-12-26 Thread Terry Reedy
On 12/26/2013 5:48 PM, Dave Angel wrote: On Thu, 26 Dec 2013 14:06:17 -0800 (PST), matt.doolittl...@gmail.com wrote: On Thursday, December 26, 2013 2:22:10 PM UTC-5, Dan Stromberg wrote: > In [1]: import time > In [2]: time.time() > Out[2]: 1388085670.1567955 OK i did what you said but I am

Re: need to print seconds from the epoch including the millisecond

2013-12-26 Thread Dave Angel
On Thu, 26 Dec 2013 14:06:17 -0800 (PST), matt.doolittl...@gmail.com wrote: On Thursday, December 26, 2013 2:22:10 PM UTC-5, Dan Stromberg wrote: > In [1]: import time > In [2]: time.time() > Out[2]: 1388085670.1567955 OK i did what you said but I am only getting 2 decimal places. You're

Re: need to print seconds from the epoch including the millisecond

2013-12-26 Thread Steven D'Aprano
matt.doolittl...@gmail.com wrote: > On Thursday, December 26, 2013 2:22:10 PM UTC-5, Dan Stromberg wrote: >> On Thu, Dec 26, 2013 at 10:32 AM, wrote: >> >> > i am using 2.7. I need to print the time in seconds from the epoch >> > with millisecond precision. i have tried many things but have

Re: need to print seconds from the epoch including the millisecond

2013-12-26 Thread matt . doolittle33
On Thursday, December 26, 2013 2:22:10 PM UTC-5, Dan Stromberg wrote: > On Thu, Dec 26, 2013 at 10:32 AM, wrote: > > > i am using 2.7. I need to print the time in seconds from the epoch with > > millisecond precision. i have tried many things but have failed. heres my > > latest: > > > >

Re: need to print seconds from the epoch including the millisecond

2013-12-26 Thread Dan Stromberg
On Thu, Dec 26, 2013 at 10:32 AM, wrote: > i am using 2.7. I need to print the time in seconds from the epoch with > millisecond precision. i have tried many things but have failed. heres my > latest: > > from time import time, strftime > from datetime import datetime, time