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 invalid@invalid.invalid 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

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

2014-01-03 Thread Grant Edwards
On 2014-01-03, Dave Angel da...@davea.name wrote: On Thu, 2 Jan 2014 16:23:22 + (UTC), Grant Edwards invalid@invalid.invalid 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

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

2014-01-02 Thread Grant Edwards
On 2013-12-26, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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, matt.doolittl...@gmail.com wrote: i am using 2.7. I need to print the time

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 invalid@invalid.invalid 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

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 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.

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,

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 matt.doolittl...@gmail.com wrote: I am on Ubuntu 12.10. I am still working with the 2 decimal places. Sometime ago

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

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 messages

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

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

2013-12-30 Thread Roy Smith
In article mailman.4714.1388407860.18130.python-l...@python.org, Ned Batchelder n...@nedbatchelder.com 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,

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 us seeing the

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

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 doesn't see how

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 news client for

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 what you said but I am

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 11:54:41 PM UTC-5, Dave Angel wrote: On Thu, 26 Dec 2013 20:03:34 -0500, Terry Reedy tjre...@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,

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

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 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 I forget

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

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 program

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

2013-12-27 Thread Roy Smith
In article roy-4a275d.13503227122...@news.panix.com, Roy Smith r...@panix.com 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 Cameron Simpson
On 27Dec2013 07:40, matt.doolittl...@gmail.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! Repeatedly people have asked you to show your exact

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 what was

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 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!

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 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

need to print seconds from the epoch including the millisecond

2013-12-26 Thread matt . doolittle33
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 # write date, time, then seconds from epoch

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, matt.doolittl...@gmail.com 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

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, matt.doolittl...@gmail.com 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

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, matt.doolittl...@gmail.com wrote: i am using 2.7. I need to print the time in seconds from the epoch with millisecond precision. i have tried many

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 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 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 millisecond?

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 tjre...@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