: This article mainly introduces PHP-date and time. For more information about PHP tutorials, see. Obtain the current Unix timestamp
From (00:00:00)-The number of seconds and
Get current date
Date ();
Date (the format of the timestamp, specifying the timestamp [current date and time by default, optional ])
// Date function, the second parameter returns the default value echo date ("Y-m-d"); // 2014-03-30 // date function, echo date ("Y-m-d", '000000') when the second parameter has a value; // 2014-03-30, 1396193923 indicates the unix timestamp of 1396193923
Obtain the timestamp of a date.
Strtotime ();
Strtotime (""); strtotime (""); // The test is also feasible
Converts formatted date strings to Unix timestamps.
strtotime("now");strtotime("+1 seconds");strtotime("+1 day");strtotime("+1 week");strtotime("+1 week 3 days 7 hours 5 seconds");
Format GMT Standard Time
// gmdate() //Y-m-d H:i:sdate_default_timezone_set("Asia/Shanghai");echo date('Y-m-d H:i:s', time());echo gmdate('Y-m-d H:i:s', time());
'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
'). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script
The above section introduces PHP-date and time, including related content, and hopes to help friends who are interested in PHP tutorials.