方式一:
>>> from time import gmtime, strftime
>>> strftime("%Y-%m-%d %H:%M:%S", gmtime())
'2009-01-05 22:14:39'
方式二:
>>> from datetime import datetime
>>> str(datetime.now())
'2011-05-03 17:45:35.177000'
方式三:
>>> from datetime import datetime
>>> datetime.now().strftime('%Y-%m-%d %H:%M:%S')
'2013-09-18 11:16:32'