###
LocalTime = Time.strftime ("%y-%m-%d%h:%m:%s", Time.localtime ())
###
Strftime formatting:
%a Locale ' s abbreviated weekday name. #英文星期的缩写%A Locale ' s full weekday name. #英文星期的全名%b Locale ' s abbreviated month name. #英文月份的缩写%B Locale ' s full month name. #英文月份的全名%c Locale ' s appropriate date andTime representation. %d day of the month as a decimal number [01,31]. #每日%H Hour (24-hour clock) as a decimal number [00,23]. #小时%I Hour (12-hour clock) as a decimal number [01,12]. %j Day of the year as a decimal number [001,366]. %m Month as a decimal number [01,12]. #数字的月份%M Minute as a decimal number [00,59]. #数字分钟%p Locale ' s equivalent of either AMorPm. (1)%s Second as a decimal number [00,61]. (2) #数字秒%u Week number of the year (Sunday as the first day of the Week) as a decimal number [00,53]. All daysinchA New year preceding the first Sunday is considered to beinchWeek 0. (3)%w Weekday as a decimal number [0 (Sunday), 6]. %W Week Number of the year (Monday as the first day of the Week) as a decimal number [00,53]. All daysinchA New year preceding the first Monday is considered to beinchWeek 0. (3)%x Locale ' s appropriate date representation. %X Locale ' s appropriate time representation. %y year without century as a decimal number [00,99]. %Y year with century as a decimal number. #年份%Z Time zone name (no charactersifno time zone exists). Percent A literal'%'Character.
###
Commonly used for:
date_fmt='%a,%d%b%Y%h:%m:%s'time.strftime ("%a,%d%b%Y%h:%m:%s ' ", Time.localtime ()) Time.strftime ("%y-%m-%d%h:%m:%s", Time.localtime ())
###
Python #time