Standard way to express a date in a real number?

sdhyok sdhyok at yahoo.com
Thu Apr 17 22:09:51 EDT 2003


sdhyok at yahoo.com (sdhyok) wrote in message news:<420ced91.0304141131.73a6206e at posting.google.com>...
> I am looking for a way to express a date in a real number
> in Python.
> 
> For instance, in MatLab,
> n = datenum(2001,12,19,18,0,0) returns n = 731204.75.
> 
> This kind of expression turned out to be very helpful
> when handling or storing dates.
> 
> Is there any funtion for the purpose in Python (e.g. in datetime module)?
> 
> Daehyok Shin

Another solution I found in mx.DateTime is:

from mx.DateTime import *
d = DateTime(1999,9,9,3,10,5)
d.absdays




More information about the Python-list mailing list