time()
echo time() . "<br/>";//1503368176
echo date("Y-m-d H:i:s") . "<br/>";//2017-08-22 02:17:35
echo date("Y-m-d H:i:s", time()) . "<br/>";//2017-08-22 02:17:35
echo date("Y-m-d H:i:s", time() + 24 * 3600);//2017-08-23 02:18:29
mktime()
echo mktime(0, 0, 0, 8, 12, 2016) . "<br/>";//1470960000
$t = mktime(0, 0, 0, 6, 1, 1990);//644198400
echo $t . "<br/>";
echo date("Y-m-d H:i:s", $t) . "<br/>";//1990-06-01 00:00:00
echo date("Y-m-d H:i:s", mktime(0, 0, 0, 6)) . "<br/>";//2017-06-22 00:00:00
echo date("Y-m-d H:i:s", mktime(0)) . "<br/>";//2017-08-22 00:27:13
$birth = mktime(0, 0, 0, 6, 1, 1990);
$time = time();
echo $age = floor(($time - $birth) / (24 * 3600 * 365)) . "<br/>";//27
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者