Fractional Hours from datetime?

Martin P. Hellwig martin.hellwig at dcuktec.org
Tue Jan 12 15:52:40 CET 2010


W. eWatson wrote:
<cut>
>>  >>> 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 application. For local, one user 
only, use, the problem will be practically non-existent. Multiple users 
across multiple machines will make it more difficult since you need a 
verified source for each users timezone. But then again what about 
travellers, wrongly set-up machines (right time wrong zone, wrong time 
right zone and wrong zone with wrong time?) or people who just prefer to 
do have their time set to UTC regardless of their location and season 
(when I travelled alot, I just set my wristwatch, phone and laptop to UTC).

-- 
MPH
http://blog.dcuktec.com
'If consumed, best digested with added seasoning to own preference.'



More information about the Python-list mailing list