php timestamp conversion
PHP中文网
PHP中文网 2017-05-16 13:09:51
0
2
393

Now that we have obtained two different timestamps from the system, is there any way to convert this difference into seconds plus milliseconds? ?

PHP中文网
PHP中文网

认证0级讲师

reply all(2)
洪涛
function getMillisecond() {
list($t1, $t2) = explode(' ', microtime());
return (float)sprintf('%.0f',(floatval($t1)+floatval($t2))*1000);
}
echo getMillisecond();

Find a function online and give it a try

刘奇

PHP’s timestamp can only go to the second level. If you add milliseconds, add 000 at the end

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template