import time now = time.localtime(time.time()) print time.asctime(now) print time.strftime("%y/%m/%d %H:%M", now) print time.strftime("%a %b %d", now) print time.strftime("%c", now) print time.strftime("%I %p", now) print time.strftime("%Y-%m-%d %H:%M:%S %Z", now)
Mon Sep 07 11:30:09 2015
15/09/07 11:30
Mon Sep 07
09/07/15 11:30:09
11 AM
2015-09-07 11:30:09 中国标准时间