[issue12772] fractional day attribute in datetime class

2011-08-20 Thread Miguel de Val Borro
Miguel de Val Borro 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, d

[issue12772] fractional day attribute in datetime class

2011-08-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: You can easily get the fractional day value using existing functionality: >>> from datetime import * >>> (datetime(2011,8,15,18,30) - datetime(2011,8,13,12,0)) / timedelta(1) 2.27083335 >>> (datetime(2011,8,15,18,30) - datetime(1970,1,1)) / tim

[issue12772] fractional day attribute in datetime class

2011-08-18 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban versions: +Python 3.3 -Python 2.7 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue12772] fractional day attribute in datetime class

2011-08-17 Thread Miguel de Val Borro
New submission from Miguel de Val Borro : 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 o