Wednesday, 17 July 2013

python formating the current date/time

>>> import datetime
>>> datetime.datetime.now()
datetime.datetime(2013, 7, 16, 7, 12, 24, 491296)
>>> datetime.datetime.now().time()
datetime.time(7, 12, 45, 859333)
>>> str(datetime.datetime.now())
'2013-07-16 07:13:40.077304'


No comments:

Post a Comment