PHP date function description

Source: Internet
Author: User
PHP date function description
Add date_default_timezone_set (PRC);/* to set the time to Beijing time. php5 defaults to Greenwich Mean Time */date ():: "am" or "pm" A: "AM" or "PM" d: days, double digits. if not, add zero. from "01" to "31" D: the day of the week, with three English letters, such as: "Fri" F: Month, full English name, such as: "January" h: 12-hour, from "01" to "12" H: 24 hours, from "00" to "23" g: 12 hours, no zeros; from "1" to "12" G: Hour in 24-hour format, do not fill in zero; from "0" to "23" j: A few days, not zero; from "1" to "31" l: Day of the week, full English name, such as: "Friday" m: month, two digits, from "01" to "12" n: month, double-digit, not zero; from "1" to "12" M: Month, 3 English letters; for example: "Jan" s: Seconds From "00" to "59" S: ending with an English number, two English letters, such as: "21th" t: specifies the number of days of the month, from "28" to "31" U: total number of seconds w: number of weeks, from "0 (Sunday)" to "6 (Saturday)" Y: year, four digits y: year, two digits z: The day of the year; from "1" to "366" mktime (): // the function returns the Unix timestamp of a date. // The parameter always indicates the GMT date, so is_dst has no effect on the result. Mktime (hour, minute, second, month, day, year, is_dst) hour: Optional. The specified hour. Minute: Optional. Minutes. Second: Optional. Specified seconds. Month: Optional. Indicates the month in number. Day: Optional. Specified day. Year: Optional. Specified year. In some systems, the valid value ranges from 1901 to 2038. However, this restriction does not exist in PHP 5. Is_dst: Optional. If the time is in the daylight saving time (DST) period, it is set to 1; otherwise, it is set to 0. if it is unknown, it is set to-1. The is_dst parameter has been deprecated since 5.1.0. Therefore, the new time zone processing feature should be used.

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.