python datetime格式化参数

坑爹啊,记忆力不行,老是记不住,都用了这么久了,记在这里以后来翻。


DirectiveMeaningNotes
%aLocale’s abbreviated weekdayname. 
%ALocale’s full weekday name. 
%bLocale’s abbreviated monthname. 
%BLocale’s full month name. 
%cLocale’s appropriate date andtime representation. 
%dDay of the month as a decimalnumber [01,31]. 
%fMicrosecond as a decimalnumber [0,999999], zero-paddedon the left(1)
%HHour (24-hour clock) as adecimal number [00,23]. 
%IHour (12-hour clock) as adecimal number [01,12]. 
%jDay of the year as a decimalnumber [001,366]. 
%mMonth as a decimal number[01,12]. 
%MMinute as a decimal number[00,59]. 
%pLocale’s equivalent of eitherAM or PM.(2)
%SSecond as a decimal number[00,61].(3)
%UWeek number of the year(Sunday as the first day ofthe week) as a decimal number[00,53]. All days in a newyear preceding the firstSunday are considered to be inweek 0.(4)
%wWeekday as a decimal number[0(Sunday),6]. 
%WWeek number of the year(Monday as the first day ofthe week) as a decimal number[00,53]. All days in a newyear preceding the firstMonday are considered to be inweek 0.(4)
%xLocale’s appropriate daterepresentation. 
%XLocale’s appropriate timerepresentation. 
%yYear without century as adecimal number [00,99]. 
%YYear with century as a decimalnumber. 
%zUTC offset in the form +HHMMor -HHMM (empty string if thethe object is naive).(5)
%ZTime zone name (empty stringif the object is naive). 
%%A literal '%' character. 
http://docs.python.org/library/datetime.html#strftime-strptime-behavior

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值