Solution: Echo strtotime (' 2013-01-01 11:11:11 ') Different machine results differ??
This post was last edited by r9000_com on 2013-03-20 10:33:24
The same two lines of code,
echo $ts = ' 2013-01-01 11:11:11 '; Echo '
";
echo Strtotime ($ts);
?>
Running on a Linux server, the result is this:
2013-01-01 11:11:11
1357009871000
But when I run on this machine, the timestamp is the other one, what's going on?
The time zone on the server is set to "asia/chongqing" and the date output is correct under Linux, which is strange. time Stamp Strtotime PHP Time Zone
------Solution--------------------
echo Date ("Y-m-d h:i:s", 1357009871);
echo Date ("Y-m-d h:i:s", 1357038671);
2013-01-01 03:11:11
2013-01-01 11:11:11
After eight hours, there must be a problem with the time zone setting.
Reference:
Reference: The time zone of the two servers is different?
Plus, why multiply by 1000? This date, under PHP is the number of seconds, JS is the number of milliseconds.
Time zone is the same, *1000 is to turn into JS timestamp
------Solution--------------------
3,600 seconds, not hard to imagine