Re: Fractional Hours from datetime?

2010-01-12 Thread W. eWatson
Ben Finney wrote: "Alf P. Steinbach" writes: And considering this, and the fact that Google's archive is now the main Usenet archive, message id's are not that useful, really. You've demonstrated only that Google is an unreliable Usenet archive. One doesn't even need to use Usenet, in this

Re: Fractional Hours from datetime?

2010-01-12 Thread Martin P. Hellwig
W. eWatson wrote: >>> now = datetime.datetime.now() >>> fractional_hour = now.hour + now.minute / 60.0 See my post about the datetime controversy about 3-4 posts up from yours. If timezones might be a problem area, than it might be worth while to see it in the context of the actual applic

Re: Fractional Hours from datetime?

2010-01-12 Thread Steve Holden
Alf P. Steinbach wrote: > * Steve Holden: >> Alf P. Steinbach wrote: >>> * W. eWatson: Ben Finney wrote: > "W. eWatson" writes: > >> See my post about the datetime controversy about 3-4 posts up from >> yours. > This forum is distributed, and there's no “up” or “3-4 messag

Re: Fractional Hours from datetime?

2010-01-12 Thread Ben Finney
"W. eWatson" writes: > See my post about the datetime controversy about 3-4 posts up from > yours. This forum is distributed, and there's no “up” or “3-4 messages” that is common for all readers. Could you give the Message-ID for that message? -- \ “As we enjoy great advantages from the

Re: Fractional Hours from datetime?

2010-01-11 Thread Alf P. Steinbach
* Steve Holden: Alf P. Steinbach wrote: * W. eWatson: Ben Finney wrote: "W. eWatson" writes: See my post about the datetime controversy about 3-4 posts up from yours. This forum is distributed, and there's no “up” or “3-4 messages” that is common for all readers. Could you give the Messag

Re: Fractional Hours from datetime?

2010-01-11 Thread David Robinow
On Mon, Jan 11, 2010 at 10:26 PM, Ben Finney wrote: > "Alf P. Steinbach" writes: > >> And considering this, and the fact that Google's archive is now the >> main Usenet archive, message id's are not that useful, really. > > You've demonstrated only that Google is an unreliable Usenet archive. > >

Re: Fractional Hours from datetime?

2010-01-11 Thread Ben Finney
"Alf P. Steinbach" writes: > And considering this, and the fact that Google's archive is now the > main Usenet archive, message id's are not that useful, really. You've demonstrated only that Google is an unreliable Usenet archive. One doesn't even need to use Usenet, in this case, since comp.l

Re: Fractional Hours from datetime?

2010-01-11 Thread Steve Holden
Alf P. Steinbach wrote: > * W. eWatson: >> Ben Finney wrote: >>> "W. eWatson" writes: >>> See my post about the datetime controversy about 3-4 posts up from yours. >>> >>> This forum is distributed, and there's no “up” or “3-4 messages” that is >>> common for all readers. >>> >>> Could y

Re: Fractional Hours from datetime?

2010-01-11 Thread Alf P. Steinbach
* W. eWatson: Ben Finney wrote: "W. eWatson" writes: See my post about the datetime controversy about 3-4 posts up from yours. This forum is distributed, and there's no “up” or “3-4 messages” that is common for all readers. Could you give the Message-ID for that message? Sort of like oute

Re: Fractional Hours from datetime?

2010-01-11 Thread Ben Finney
"W. eWatson" writes: > Ben Finney wrote: > > Could you give the Message-ID for that message? > > > Sort of like outer space I guess. No real direction. How would I find > the message ID? It is a field in the header of every message. Show the full header, and look for the field named ‘Message-ID’

Re: Fractional Hours from datetime?

2010-01-11 Thread W. eWatson
Ben Finney wrote: "W. eWatson" writes: See my post about the datetime controversy about 3-4 posts up from yours. This forum is distributed, and there's no “up” or “3-4 messages” that is common for all readers. Could you give the Message-ID for that message? Sort of like outer space I guess

Re: Fractional Hours from datetime?

2010-01-11 Thread W. eWatson
Martin P. Hellwig wrote: Martin P. Hellwig wrote: W. eWatson wrote: Maybe there's a more elegant way to do this. I want to express the result of datetime.datetime.now() in fractional hours. Here's one way. dt=datetime.datetime.now() xtup = dt.timetuple() h = xtup[3]+xtup[4]/60.0+xtup[5]/3600

Re: Fractional Hours from datetime?

2010-01-11 Thread W. eWatson
Martin P. Hellwig wrote: Martin P. Hellwig wrote: W. eWatson wrote: Maybe there's a more elegant way to do this. I want to express the result of datetime.datetime.now() in fractional hours. Here's one way. dt=datetime.datetime.now() xtup = dt.timetuple() h = xtup[3]+xtup[4]/60.0+xtup[5]/3600

Re: Fractional Hours from datetime?

2010-01-11 Thread W. eWatson
Austyn wrote: Here's an improvement in case you want your code to work outside of Arizona: from time import time, timezone h = ((time() - timezone) / 3600) % 24 On Jan 10, 9:04 pm, Austyn wrote: How about: import time arizona_utc_offset = -7.00 h = (time.time() / 3600 + arizona_utc_offset) %

Re: Fractional Hours from datetime?

2010-01-11 Thread Martin P. Hellwig
Martin P. Hellwig wrote: W. eWatson wrote: Maybe there's a more elegant way to do this. I want to express the result of datetime.datetime.now() in fractional hours. Here's one way. dt=datetime.datetime.now() xtup = dt.timetuple() h = xtup[3]+xtup[4]/60.0+xtup[5]/3600.00+xtup[6]/10**6 # now i

Re: Fractional Hours from datetime?

2010-01-11 Thread Martin P. Hellwig
W. eWatson wrote: Maybe there's a more elegant way to do this. I want to express the result of datetime.datetime.now() in fractional hours. Here's one way. dt=datetime.datetime.now() xtup = dt.timetuple() h = xtup[3]+xtup[4]/60.0+xtup[5]/3600.00+xtup[6]/10**6 # now is in fractions of an hour

Re: Fractional Hours from datetime?

2010-01-11 Thread M.-A. Lemburg
W. eWatson wrote: > Maybe there's a more elegant way to do this. I want to express the > result of datetime.datetime.now() in fractional hours. > > Here's one way. > > dt=datetime.datetime.now() > xtup = dt.timetuple() > h = xtup[3]+xtup[4]/60.0+xtup[5]/3600.00+xtup[6]/10**6 > # now is in fracti

Re: Fractional Hours from datetime?

2010-01-10 Thread Austyn
Here's an improvement in case you want your code to work outside of Arizona: from time import time, timezone h = ((time() - timezone) / 3600) % 24 On Jan 10, 9:04 pm, Austyn wrote: > How about: > > import time > arizona_utc_offset = -7.00 > h = (time.time() / 3600 + arizona_utc_offset) % 24 > >

Re: Fractional Hours from datetime?

2010-01-10 Thread Austyn
How about: import time arizona_utc_offset = -7.00 h = (time.time() / 3600 + arizona_utc_offset) % 24 dt.timetuple()[6] is the day of the week; struct tm_time doesn't include a sub-second field. On Jan 10, 10:28 am, "W. eWatson" wrote: > Maybe there's a more elegant way to do this. I want to exp

Fractional Hours from datetime?

2010-01-10 Thread W. eWatson
Maybe there's a more elegant way to do this. I want to express the result of datetime.datetime.now() in fractional hours. Here's one way. dt=datetime.datetime.now() xtup = dt.timetuple() h = xtup[3]+xtup[4]/60.0+xtup[5]/3600.00+xtup[6]/10**6 # now is in fractions of an hour -- http://mail.pyth