Standard way to express a date in a real number?

Nicola Mingotti tuco at
Mon Apr 14 23:18:19 CEST 2003

"sdhyok" <sdhyok at> wrote in message
news:420ced91.0304141131.73a6206e at

> 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

import time
t = time.time()
# t is the number you asked for 

If you want to know more about this look at 
the "time" module .


Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

More information about the Python-list mailing list