1. The time() function returns the number of seconds of the current time since the Unix epoch (January 1 1970 00:00:00 GMT).
echo time(); //output 1531201452.
2. The date('format',time()) function is used to format the time/date. The time() parameter can be omitted.
echo
date
(
'Y-m-d h:i:s'
, time());
// 2016-12-31 05:07:05 h为12小时制
echo
date
(
'Y-m-d H:i:s')
;
// 2016-12-31 13:07:05 H为24小时制