Get System Date?

Magnus Lycka lycka at carmen.se
Sun Feb 5 17:08:06 EST 2006


Dave wrote:
> Dustan,
> 
> Python has a module called, appropriately, "time". 

This is basically a wrapper around the standard C time
library. Python has a more modern and spiffy datetime
module which isn't restrained to 1970-2038, and just
handles spiffy date and datetime objects instead of
making you deal with awkward conversions between strange
numbers and obscure tuples. The old time module does work,
but due to e.g. strange assymetries in the module, you
have to deal with strange quirks to convert UTC times
right...

 >>> import datetime
 >>> datetime.datetime.now()
datetime.datetime(2006, 2, 5, 23, 1, 45, 569833)



More information about the Python-list mailing list