python中设置时间格式--模块datetime中日期和时间格式的参数

模块datetime中设置日期和时间格式的实参
实参 含义
%A 本地完整星期名称
%a 本地简化星期名称
%B 本地完整的月份名称
%b 本地简化的月份名称
%m(month的首字母) 用数字表示的月份(0-12)
%d(day的缩写) 用数字表示月份中的一天(1-31)
%Y(Year的缩写) 四位的年份,如2020
%y(year的缩写) 两位的年份,如19
%H(Hour的缩写) 24小时制的小时数(0-23)
%I 12小时的小时数(1-12)
%p am或者pm
%M(Minute的缩写) 分钟数(0-59)
%S(Second) 秒数(0-59)

猜你喜欢

转载自blog.csdn.net/hanhanwanghaha/article/details/108033169