As we all know, php {code ...} the function can generate a 10-bit Unix timestamp, but in javascript, {code...} is used ...} the timestamp obtained by the function is 13 BITs accurate to milliseconds. So can I use php to generate a javascript-style Unix timestamp? PS: Yes... as we all know, php's
time();mktime();
The function can generate a 10-bit Unix timestamp, but in javascript
new Date().getTime()
The timestamp obtained by the function is 13 BITs accurate to milliseconds.
So can I use php to generate a javascript-style Unix timestamp?
PS: php code is required to run without any redundant output, but to simply output a 13-bit Unix timestamp.
PPS: time () * 1000 is not counted. Time () + random number is also not counted...
Reply content:
As we all know, php's
time();mktime();
The function can generate a 10-bit Unix timestamp, but in javascript
new Date().getTime()
The timestamp obtained by the function is 13 BITs accurate to milliseconds.
So can I use php to generate a javascript-style Unix timestamp?
PS: php code is required to run without any redundant output, but to simply output a 13-bit Unix timestamp.
PPS: time () * 1000 is not counted. Time () + random number is also not counted...
I am wrong. After the question is sent, the answer is found. Php provided another function to complete this task.
round(microtime(true) * 1000)