Figuring out Gregorian date from hours since 0001-01-01

Alexander Lawhead alawhead at vcn.bc.ca
Fri Sep 1 17:09:56 EDT 2000


I'm extracting data from a set of packaged data files and am having a
problem converting the dates into a useable format. Each observation's
date is given as the number of hours since 0001-01-01. I picked up the
mxDateTime pacakge, thinking that it would be easy to convert this into an
equivalent Gregorian date. After a quick run through of the docs I'm
stumped. Going from number of days or number of seconds from 0001-01-01 is
easy... hours doesn't seem right. If I naively convert hours to days by
dividing by 24 I'm off by a few days.

Any ideas?

Thanks,

Alexander




More information about the Python-list mailing list