PHP Date () method parameters detailed and get the day of the week ~

Source: Internet
Author: User

PHP Week to get code:
Date ("L"); Data will be available for English week like Sunday
Date ("W"); This can get a digital week like 123, note 0 is Sunday

Get Chinese day of the week:
$weekarray =array ("Day", "one", "two", "three", "four", "five", "six"); First define an array
echo "Week". $weekarray [Date ("W")];

Get the specified date is:
$weekarray =array ("Day", "one", "two", "three", "four", "five", "six");
echo "Week". $weekarray [Date ("W", "2011-11-11")];

Because the date function is very powerful, he is perfectly capable of doing all this work. I have a table in the manual for easy access to
1. A-"AM" or "PM"
2. A-"AM" or "PM"
3. D-A few days, two digits, if less than two digits in front of 0, such as: "01" to ""
4. D-Days of the week, three English letters; such as: "Fri"
5. F-month, full name in English; such as: "January"
6 h-12 hours, such as: "01" to "7"
. H-24 hours of hours; such as: "00" to "a"
8. G-12 hours, less than two bits does not complement 0, such as: "1" to "
9. G-24 hours of hours, less than two to fill 0; such as: "0" to "a"
. I-minutes, such as: "00" to "five"
One. J-A few days, two digits, if less than two digits do not fill 0, such as: "1" to "the"
, the day of the week, the full name of the English language, such as: "Friday"
. M-month, two digits, if less than two digits in front of 0, such as: "01" to "a"
N-month, two digits, if less than two digits do not fill 0, such as: "1" to "a"
15. M-month, three English letters; such as: "The" "00" to "17"
. S-seconds; S-word tail plus English ordinal number, two English letters; such as: "th", "nd"
T-Specify the number of days of the month, such as: "28" to "
19." U-Total seconds
W-Number of days of the week, such as: "0" (Sunday) to "6" (Saturday)
21. Y-year, four digits; such as: "1999"
Y-year, two digits, such as: "" "
Z-the first days of the year, such as:" 0 "to" 365 " 

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.