The date () function of php determines the day of the week.

Source: Internet
Author: User
Tags iso 8601 iso 8601 format
D & amp; nbsp; the day of the month, which has the 2nd digit from the leading zero, 01 to 31 & amp; nbsp; D & amp; nbsp; the day of the week, expressed in text, 3. Mon to the day of Sun & amp; nbsp; j & amp; nbsp; month

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 New plus) 1 (Monday) to 7 (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

The week of the year in W ISO-8601 format, starting from Monday every week (new in PHP 4.1.0) 42 (42nd weeks of the year)

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

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.

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.

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>

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). There are colons between hours and minutes, for example: +

T the time zone of the local machine

The number of seconds of the Z time difference offset. The time zone offset to the west of UTC is always negative, and the east of UTC is positive. -43200 to 43200

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

U obtains the timestamp from the Unix epoch (January 1 1970 00:00:00 GMT) to the current time ().

The date () function of php is very powerful. through the above parameters, you can perform many date Operations. for example, you can obtain the red parameter descriptions marked above to implement the day of the week today!

Run the "w" parameter: php code is as follows:


 

You can also use the switch statement to achieve the same effect:


 

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.