PHP time format controller table sharing _ PHP Tutorial

Source: Internet
Author: User
Tags iso 8601 iso 8601 format
Share the Control List of PHP time formats. The format character specifies the return value. for example, the day in the month ------ d, the number of the day in the month contains the 2nd digit of the leading zero, 01 to 31j, and no leading zero, 1 to 31S, or after the number of days in the month.
Format Description Return value example
Day --- ---
D The day of the month, which has two digits leading to zero 01 to 31
J The day of the month, with no leading zero 1 to 31
S English suffix after the number of days per month, 2 characters St, nd, rd or th. Can be used with j
Z The day of the year. 0 to 366
Week --- ---
L (lowercase letters of "L) Day of week, complete text format Sunday to Saturday
D The day of the week. The text indicates three letters. Mon to Sun
N The day of the week represented by a number in the ISO-8601 format (new in PHP 5.1.0) 1 (Monday) to 7 (Sunday)
W The day of the week, represented by a number 0 (Sunday) to 6 (Saturday)
W The week of the year in ISO-8601 format, starting from Monday each week (new in PHP 4.1.0) Example: 42 (42nd weeks of the current year)
Month --- ---
F The month in the complete text format, such as January or March. January to December
M Number indicates the month, with a leading zero 01 to 12
M The month abbreviated to three characters. Jan to Dec
N Number indicates the month, with no leading zero 1 to 12
T Number of days in a given month 28 to 31
Year --- ---
L Is it a leap year? If the leap year is 1, otherwise it is 0
O The number of years in ISO-8601 format. This is the same as Y, except that the week number (W) of ISO belongs to the previous year or the next year. (New PHP 5.1.0) Examples: 1999 or 2003
Y The year in which the four digits represent the complete number. Example: 1999 or 2003
Y A two-digit year Example: 99 or 03
Time --- ---
A Morning and afternoon values in lower case Am or pm
A Upper-case morning and afternoon values AM or PM
B Swatch Internet standard 000 to 999
G Hour, 12-hour format, no leading zero 1 to 12
G Hour, in 24-hour format, no leading zero 0 to 23
H Hour, 12-hour format, with leading zero 01 to 12
H Hour, in 24-hour format, with a leading zero 00 to 23
I Minutes with a leading zero 00 to 59>
S Number of seconds, with a leading zero 00 to 59>
Time zone --- ---
E Time zone ID (new in PHP 5.1.0) Example: UTC, GMT, Atlanta/Azores
I When it is enabled or not If this parameter is set to 1, otherwise it is set to 0.
O Hours different from Greenwich Mean Time For example: + 0200
P Difference from Greenwich Mean Time (GMT), separated by colons between hours and minutes (new in PHP 5.1.3) Example: +
T Time zone of the local machine For example, EST and MDT are in full text format in Windows. for example, "Eastern Standard Time" is displayed in Chinese ").
Z The number of seconds of the time difference offset. The time zone offset to the west of UTC is always negative, and the time zone offset to the east of UTC is always positive. -43200 to 43200
Complete date/time --- ---
C Date in ISO 8601 format (new in PHP 5) 2004-02-12T15: 19: 21 + 00: 00
R Date in RFC 822 format Example: Thu, 21 Dec 2000 16:01:07 + 0200
U The number of seconds since the Unix epoch (January 1 1970 00:00:00 GMT), that is, the timestamp. SeeTime ()

The http://www.bkjia.com/PHPjc/328108.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/328108.htmlTechArticleformat character specifies the return value example date --- the day of the d month, there is a leading zero of the two digits 01 to 31 j of the day of the month, no leading zero 1 to 31 S after the number of days per month...

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.