How to get the prayer method in PHP simple introduction

Source: Internet
Author: User
PHP Get Week method Daquan Simple Introduction
PHP Gets the week method Daquan simple introduction, PHP week to get code:

1 Date ("L");

2//data can get English for weeks like Sunday

3 Date ("W");

4//This can get digital weeks like 123, note 0 is Sunday

Get Chinese Weekday:

1 $weekarray =array ("Day", "one", "two", "three", "four", "Five", "VI");

2//define an array first

3 echo "Week". $weekarray [Date ("W")];

Gets the specified date:

1 $weekarray =array ("Day", "one", "two", "three", "four", "Five", "VI");

2 echo "Week". $weekarray [Date ("W", "2011-11-11")];

Because the date function is so powerful, he can do all this work. I'll attach a table in my handbook. Easy access at any time

1 A-"AM" or "PM"

2 A-"AM" or "PM"

3 D-A few days, two digits, if less than two digits are preceded by 0; for example: "01" to "31"

4 D-Day of the week, three English letters; e.g. "Fri"

5 F-month, full name in English, e.g. "January"

6 hours of h-12 hours, e.g. "01" to "12"

7 h-24 hour hour, e.g. "00" to "23"

8 g-12 hour, less than two not 0; for example: "1" to 12 "

9 G-24-hour hour, less than two digits not 0; For example: "0" to "23"

Ten i-minute; for example: "00" to "59"

J-A few days, two digits, if less than two bits do not fill 0, such as: "1" to "31"

L-Day of the week, English full name, e.g. "Friday"

M-month, two digits, if less than two digits in front of 0, such as: "01" to "12"

N-month, two digits, if less than two, does not fill 0, for example: "1" to "12"

Four M-month, three English letters, such as: "Jan"

(s)-second: "00" to "59"

+ S-tail with English ordinal number, two English letters, such as: "th", "nd"

T-the number of days in the specified month, e.g. "28" to "31"

U-Total number of seconds

W-Number of days of the week, such as: "0" (Sunday) to "6" (Saturday)

Y-year, four digits; for example: "1999"

Y-year, two digits; for example: "99"

Z-the day of the year, for example: "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.