Sunday, May 22, 2011

Getting the Current Time/Date in Python

import datetime
dt = datetime.datetime.now()
print dt.year
print dt.month
print dt.day
print dt.hour
print dt.minute
print dt.second

No comments:

Post a Comment

Followers