Finishing Live: PHP's date and time function date ()
1, Year - Month - Day
echo date ('Ym-j');
echo date ('yn-j');
Y said the four-digit years uppercase and lowercase y, said double-digit year;
Lower case m represents the month number (with leading), while the lowercase n indicates the month without leading numbers.
echo date ('YM-j');
echo date ('Ym-d');
Uppercase M 3 of the month abbreviation characters, and lowercase m indicates the number of the month (with leading 0);
No uppercase J, only the lower case j represents the month of the date, no leading o; If you need to use the month with a leading lowercase d.
echo date ('YM-j');
echo date ('YF-jS');
Uppercase M 3 of the month abbreviation characters, and the English capital F represents the month in full. (No lowercase f)
Capital S represents the date of the suffix, such as "st", "nd", "rd" and "th", the specific date to see a breakdown.
That can be used in uppercase and lowercase Y y;
That can be used on capital F, capital M, lowercase m and the lower case n (respectively, two ways of characters and numbers);
That can be used at lower-case d and lower case j, upper case S represents the date of the suffix.
2 hours: minutes: seconds
By default, PHP shows the time to explain as "Greenwich Mean Time", and our local time is 8 hours.
echo date ('g: i: s a');
echo date ('h: i: s A');
Lower case g said the 12-hour, no leading 0, and lowercase h indicates a leading 0 to 12 hour clock.
When you need 12-hour show on the afternoon, said a lower case lower case "am" and "pm", said the uppercase uppercase A "AM" and "PM".
echo date ('G: i: s');
G said the 24-hour caps the number of hours, but without leading to; use uppercase H, said the 24-hour clock with leading Hours
The letter g for hours without leading, the letter h is the hour with leading;
Lower case g, h said the 12-hour clock, uppercase G, H, said 24 hours.
3, a leap year, weeks, days
echo date ('L');
This year is a leap year: 0
echo date ('l');
Today is: Tuesday
echo date ('D');
Today is: Tue
Year to determine whether capital L that leap, Boolean value, is true returns 1, otherwise 0;
Lowercase l that the day of the week in English in full (Tuesday);
The day of the week uppercase D to 3-character abbreviation (Tue).
echo date ('w');
Day of the week: 2
echo date ('W');
This week is the first 06 weeks throughout the year
Lowercase w day of the week, said the capital W in digital form, said the number of weeks a year
echo date ('t');
This month is 28 days
echo date ('z');
Today is the first 36 days this year
Lowercase t represents the current month and the number of days that today is the lowercase z in the first few days of this year
echo date ('T');
Capital T means that the server's time zone settings
echo date ('I');
I said that the current capital to determine whether daylight saving time, is true returns 1, otherwise 0
echo date ('U');
Uppercase U said that from January 1, 1970 to the present total number of seconds, that is, the UNIX timestamp Unix time epoch.
echo date ('c');
2007-02-06T14: 24:43 +00:00
ISO8601 lowercase c that date, the date format YYYY-MM-DD, the letter T to the interval with the date and time, time format is HH: MM: SS, use the Time Zone Greenwich Mean Time (GMT) to represent the deviation.
echo date ('r');
Tue, 06 Feb 2007 14:25:52 +0000
Lowercase r that RFC822 date.
Small date () PHP function to display the power and charm, and then compare the next ASP, hehe.
PHP in the Baidu search the complete date and time function date () the content, or to use Google search more relevant