Try to use two methods of php to obtain the current timestamp. There are differences, but the two timestamps are converted into time at the same time point. I checked the unit of the timestamp on the network is seconds. Why is this happening?
$currentDay = getdate();
//var_dump($currentDay);
//2.1 获取当前的日期
//echo $currentDay["year"]."-".$currentDay["mon"]."-".$currentDay["mday"]."<br/>";
echo "时间戳为1:".strtotime(date("Y-m-d h:m:s"))."<br/>";
echo "时间戳为2:".$currentDay[0]."<br/>";
$time1 = strtotime(date("Y-m-d h:m:s"));
echo "不同的时间为:".date("Y-m-d H:m:s a",$currentDay[0])."--".date("Y-m-d H:m:s a",$time1);
The output result is:
The timestamp is 1:1492131843
The timestamp is 2:1492134903
The different times are: 2017-04-14 09:04:03 am--2017-04- 14 09:04:03 am
should be:
It is recommended that the poster read more php manual. Link
https://www.bytelang.com/o/s/...
You wrote it wrong yourself!
You wrote it wrong yourself
Year, month, day, hours, minutes and seconds correspond to Y-m-d h:i:s