import time
start = "2017-01-01"
end = "2017-8-12"
startTime = time.strptime(start,"%Y-%m-%d")
endTime = time.strptime(end,"%Y-%m-%d") #第二个参数format指定格式
print(startTime);print(endTime)
_start = time.strftime('%Y%m%d-%H:%M:%S',startTime)
_end = time.strftime('%Y%m%d-%H:%M:%S',endTime) #参数位置刚好相反
print(_start)
print(_end)
startStamp = time.mktime(startTime) #time => 时间戳 endStamp = time.mktime(endTime) print(startStamp) print(endStamp) _startTime = time.localtime(startStamp) # 时间戳 => time print(_startTime)
print (int((endStamp-startStamp)/(24*60*60)))
%a 英文星期简写 %A 英文星期的完全 %b 英文月份的简写 %B 英文月份的完全 %c 显示本地日期时间 %d 日期,取1-31 %H 小时, 0-23 %I 小时, 0-12 %m 月, 01 -12 %M 分钟,1-59 %j 年中当天的天数 %w 显示今天是星期几 %W 第几周 %x 当天日期 %X 本地的当天时间 %y 年份 00-99间 %Y 年份的完整拼写
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有