PHP format date usage code, including the leading zero example _ PHP Tutorial

Source: Internet
Author: User
Tags iso 8601 iso 8601 format
PHP format date usage code, including the leading zero example. PHP format date usage code, including the leading zero example: format character description return value example d the day of the month, with the leading zero number 01 to the day of the 31D day of the week

PHP format date usage code, including the example of leading zero:

Format
D. The day of the month, which has two numbers from the leading zero, 01 to 31.
D. The day of the week. The text indicates the three letters Mon to Sun.
The day of month j, with no leading zeros 1 to 31
L ("L" lowercase letter) day of the week, complete text format Sunday to Saturday
N ISO-8601 format number represents the day of the week (PHP 5.1.0 plus) 1 (representing Monday) to 7 (representing Sunday)
The suffix of S after the number of days per month. it can contain 2 characters including st, nd, rd, and th. Can be used with j
The day of the week. The number indicates 0 (Sunday) to 6 (Saturday)
Day 0 to 366 in year z
Week ------
The week of the year in W ISO-8601 format, starting from Monday each week (new in PHP 4.1.0) for example: 42 (42nd weeks of the year)
Month ------
F month, complete text format, such as January or March January to December
The month represented by m numbers, with a leading zero from 01 to 12
M: The month Jan to Dec.
N indicates the month with no leading zeros 1 to 12.
T the number of days in a given month from 28 to 31
Year ------
L whether it is a leap year. if it is a leap year, it is 1; otherwise, it is 0.
O ISO-8601 format year number. 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

Veryhuo.com


The year in which the four digits of Y are complete, for example, 1999 or 2003.
The year represented by y two digits, for example, 99 or 03.
Time ------
A lower-case morning and afternoon values: am or pm
A capital value of AM and 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 0 to 23
H-hour, 12-hour format, with a leading value of 0 to 12
H-Hour, in 24-hour format, with a leading zero 00 to 23
I have the number of minutes leading to zero from 00 to 59>
S seconds, with a leading zero 00 to 59>
Time zone ------
E time zone identifier (new in PHP 5.1.0) for example: UTC, GMT, Atlanta/Azores
When I is running or not, if it is running, it is 1; otherwise, it is 0.
O hours different from Greenwich Mean Time, for example: + 0200
The difference between P and Greenwich Mean Time (GMT). the hour and minute are separated by a colon (new in PHP 5.1.3), for example: +
T the Time zone of the local machine, for example, EST and MDT ([note] in Windows, the full text format, for example, "Eastern Standard Time", the Chinese version will display "China Standard Time ").
The number of seconds of the Z 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 --- liehuo.net
Date in c ISO 8601 format (new PHP 5): 19: 21 + 00: 00
Date in RFC 822 format: Thu, 21 Dec 2000 16:01:07 + 0200
The number of seconds since the Unix epoch (January 1 1970 00:00:00 GMT). For more information, see time () veryhuo.com.

The nth format character indicates the number of days in the return value example d. There are two digits leading to zero, 01 to 31 D, and the nth day in the week...

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.