Python #time

Source: Internet
Author: User

###

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.