[issue12772] fractional day attribute in datetime class

2011-08-20 Thread Miguel de Val Borro

Miguel de Val Borro miguel.de...@gmail.com added the comment:

Thanks, I need the fractional day added to the ordinal day of the month. Using 
the timedelta division it would be:

 from __future__ import division
 dt = datetime.datetime(2008, 5, 8, 13, 35, 41, 56)
 dt.day + (dt-datetime.datetime(dt.year, dt.month, 
 dt.day))/datetime.timedelta(1)
8.566453330752315

Then it simply becomes a one line function so I'm closing this ticket.

--
status: pending - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12772
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12772] fractional day attribute in datetime class

2011-08-17 Thread Miguel de Val Borro

New submission from Miguel de Val Borro miguel.de...@gmail.com:

It would be useful to have a fractional day method in datetime.datetime
that returns a float object calculated from the day, hour, minute, second, and 
microseconds. Fractional days in UTC are often used in science, in particular 
to record astronomical observations.

--
messages: 142286
nosy: Miguel.de.Val.Borro
priority: normal
severity: normal
status: open
title: fractional day attribute in datetime class
type: feature request
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12772
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com