如下将输出类似 的格式:
Wed Nov 4 21:03:24 CST 2015
time_str = datetime.datetime.now().strftime("%c")
如下,将输出标准时间格式:
2015-11-11 19:10:52
time_str = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
参考http://www.tutorialspoint.com/python/time_strftime.htm