Php date format description _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
Php date format description. The date format details that all functions in php are in the unix epoch, that is, since January 1, 1970. The date is the number of seconds from this time. Detailed description of the second date format counted from this time when a function is called
All functions in php are in the unix era, that is, since January 1, 1970. The date is the number of seconds from this time. When a function is called in seconds, it is treated as a timestamp (times *** p.
Local time functions
1. string date (string format, inieger times ***** p)
This function returns a time string controlled by string format.
For example:

Print (date ("y, m, d"); // output current, year, month, and day.
Print (date ("y, m, d,", 60*60*24*365*10); // output for April 1, January 1, 1980.
?>
Maybe you will ask, why is there no times *** p? If times ***** p is null or is not written, the current time is used. times ***** p.
The control operator of the year: y --- four-digit year y --- two-digit year
Indicates the control operator of the month: m --- from month f --- English month name m --- abbreviated month name
Control operator for day: d --- date j in the month with 0 in front -- date without 0 in front
Indicates the control letter of the week: l -- English week d -- abbreviation of the week
The hour controller: h -- hour from 1 to 12 h --- hour from 0 to 23
Indicates the Control Letter a --- am or pm of the previous afternoon.
Indicates the minute controller: I --- value 00-59
The number of days in a year: z -- the number of days in a year
2. array getdate (integer times ***** p)
This function returns a matrix.
For example:

  


Note:
Element description
Hour in the 24-hour format
Date in mday month
Minutes
Month in the form of mon
Full name of month
Seconds
The number of weeks in the format of 0 to 6 for wday
Weekday
Year
0 timestamp is the number of seconds from January 1, January 1, 1970 to the present.
A date in the digit format of a year in yday
3. boolean checkdate (integer month, integer day, integer year)


All functions in php are in the unix era, that is, since January 1, 1970. The date is the number of seconds from this time. The number of seconds when a function is called...

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.