The same two lines of code,
"; Echo strtotime ($ts);? >
Running on a Linux server, the result is this:
2013-01-01 11:11:111357009871000
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.
Reply to discussion (solution)
You should post the results on two machines separately.
Re-send me my question.
The same Code
"; Echo (Strtotime ($st) *); echo"
"; Echo $ts = (Strtotime ($st) * +)-(Strtotime (' 01-01-1970 00:00:00 ') * 1000);? >
To run the results on a Linux server:
2013-01-01 11:11:1113570098710001357035071000
Running the results on my own machine is different:
2013-01-01 11:11:1113570098710001357038671000
Solve Ah ...
Re-send me my question.
The same Code
"; Echo (Strtotime ($st) *); echo"
"; Echo $ts = (Strtotime ($st) * +)-(Strtotime (' 01-01-1970 00:00:00 ') * 1000);? >
To run the results on a Linux server:
2013-01-01 11:11:1113570098710001357035071000
The results are different on my own local machine: (winxp+wamp2.1)
2013-01-01 11:11:1113570098710001357038671000
Solving..
Are the time zones of the two servers different?
Plus, why multiply by 1000? This date, under PHP is the number of seconds, JS is the number of milliseconds.
Are the time zones of the two servers 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
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 4 Floor Luciferstar reply: 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
3,600 seconds, not hard to imagine
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 to the 5 floor r9000_com reply: Reference 4 floor Luciferstar ...
This time zone
3,600 seconds, not hard to imagine
It's a 3,600-second difference, but I don't know what caused it.
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 to the 5 floor r9000_com reply: Reference 4 floor Luciferstar ...
The comparison should be the two, as this is the result of different results on both machines:
1357038671000
1357035071000
Have found the answer, because the time zone in the php.ini to asia/chongqing and Asia/shanghai, so it will be an hour apart, I changed the php.ini time zone to Asia/shanghai, problem resolution, thank you for answering