Python 日期格式相关
#-*- coding: gb2312 -*-import datetime, time
#now = time.strftime('%Y年%m月%d日 %H时%M分%S秒', time.localtime()).decode('utf-8')
now = time.strftime('%Y年%m月%d日 %H时%M分%S秒', time.localtime())
print now
now = time.strptime(now, '%Y年%m月%d日 %H时%M分%S秒')
print now
print time.strftime('%Y-%m-%d %H:%M:%S', now)
页:
[1]