Date ("Y-m-d", Time ()) gets a string of times in a particular format. Time () is a timestamp value, or it can be omitted, the default current time. You can also fill in the value.
All functions in PHP are in the Unix era, starting January 1, 1970. The date is the number of seconds to start at this time. When a function call is counted as a number of seconds from this time, it is treated as a (timestamp) timestamp.
local time function
1. String date (string Format,inieger timestamp)
The function returns a string representing the time, which is controlled by the string format.
Such as:
?
Print (Date ("Y year M month D Day");//output current, Month day.
Print (Date ("Y year M month D Day", 60*60*24*365*10);//Output January 1, 1980.
?>
Perhaps you would ask, "How come there is no timestamp?" If timestamp is empty, or does not write, it indicates that the current time timestamp is used.
The control character that represents the year: Y---Four-bit year y---two-bit years
The control character that represents the month: M---The month name from 1-12 months F---English month name m---abbreviated month
The control character that represents the day number: D---0 of the month before the date j--there is no 0 in front of the day number
The control character for the week: l--English week d--Week
The control character that represents the hour: h--from 1-12 hours h---from 0 to 23 hours
Represents the control character a---am or pm a---am or PM in the afternoon
The control character that represents the minute: I---Take a value of 00-59
Another z--date of the year
Take days in one months: echo date (' t ', Mktime (1,1,1, month,1, year));
2. Array getdate (integer timestamp)
The function returns a matrix.
Such as:
?
$current _date=getdate ();
Print ($current _date ("hours"));
Print ($current _date ("minutes");
Print ($current _date ("seconds");
?>
Description
Element description
Hours 24-hour format hour
Mday date in month
Minutes minutes
Mon numeric form of the month
Month Month full name
Seconds number of seconds
Wday from 0 to 6 of the number of weeks of the form
Weekday the name of the day of the week
Year years
0 time stamp that's the number of seconds from January 1, 1970 to now
Yday the date of the year in digital form
3. Boolean checkdate (integer month,integer day,integer year) This article links http://www.cxybl.com/html/wlbc/Php/20130622/38772.html