标签:image style from 类型转换 时间 .com sep 输出 创建
from datetime import datetime now = datetime.now() print(now) utcnow = datetime.utcnow() print(utcnow)
from datetime import datetime t=datetime(2017, 5, 23, 12, 20) print(t)
from datetime import datetime spt=datetime.strptime(‘2017/9/30‘,‘%Y/%m/%d‘) print(spt) t=datetime.strptime(‘2017年9月30日星期六‘,‘%Y年%m月%d日星期六‘) print(t) pt=datetime.strptime(‘2017年9月30日星期六8时42分24秒‘,‘%Y年%m月%d日星期六%H时%M分%S秒‘) print(pt) sp=datetime.strptime(‘9/30/2017‘,‘%m/%d/%Y‘) print(sp) f=datetime.strptime(‘9/30/2017 8:42:50 ‘,‘%m/%d/%Y %H:%M:%S ‘) print(f)
from datetime import datetime str1=datetime(2017,9,28,10,3,43) print(str1.strftime(‘%Y年%m月%d日%A%H时%M分%S秒‘)) str2=datetime(2017,9,30) print(str2.strftime(‘%A,%B %d,%Y‘)) str3=datetime(2017,9,30,9,22,17) print(str3.strftime(‘%m/%d/%Y %I:%M:%S %p‘)) print(str2.strftime(‘%B %d,%Y‘))
from datetime import datetime now =datetime.now() print(now.strftime(‘今天是%Y年%m月%d日‘)) print(now.strftime(‘今天是这周的第%w天‘)) print(now.strftime(‘今天是今年的第%j天‘)) print(now.strftime(‘今周是今年的第%W周‘)) print(now.strftime(‘今天是当月的第%d天‘))
标签:image style from 类型转换 时间 .com sep 输出 创建
原文地址:http://www.cnblogs.com/guomeiting/p/7613737.html