1. 程式人生 > >獲取當前時間的毫秒時間戳

獲取當前時間的毫秒時間戳

list($msec, $sec) = explode(' ', microtime());     # 0.85447400 1543975789

$msectime = (float)sprintf('%.0f', (floatval($msec) + floatval($sec)) * 1000);

echo $msectime; #1543975789855

得到的$msectime 即為當前的毫秒時間戳