As we all know, PHP's
time();mktime();
function can generate a 10-bit UNIX timestamp, but in JavaScript, use the
new Date().getTime()
The timestamp of the function is 13 bits accurate to milliseconds.
So would it be possible to implement a JavaScript-style Unix timestamp using PHP?
PS: The PHP code is required to run without any extra output, but simply output a 13-bit UNIX timestamp.
Pps:time () *1000 not counted. Time () + random number does not count ...
Reply content:
As we all know, PHP's
time();mktime();
function can generate a 10-bit UNIX timestamp, but in JavaScript, use the
new Date().getTime()
The timestamp of the function is 13 bits accurate to milliseconds.
So would it be possible to implement a JavaScript-style Unix timestamp using PHP?
PS: The PHP code is required to run without any extra output, but simply output a 13-bit UNIX timestamp.
Pps:time () *1000 not counted. Time () + random number does not count ...
I was wrong. After the problem, we found the answer. Originally, PHP provided another function to accomplish this task.
round(microtime(true) * 1000)