emmmmmm,别说话,我们偷偷偷狗子

格式 | yyyyMMddHHmmssSSS

代码

获取毫秒

//获取当前时间毫秒
function msectime()
{
    list($msec, $sec) = explode(' ', microtime());
    $msectime =  (float)sprintf('%.0f', (floatval($msec) + floatval($sec)) * 1000);
    return $msectime;
}

 

获取精确时间

$time = msectime();
$ts = date('YmdHis').substr($time, -3);

 

ps: 如果出现获取时间与当前时间不一致,请设置下时区

date_default_timezone_set('PRC');

 

相关文章:

  • 2022-02-01
  • 2022-12-23
  • 2022-02-08
  • 2021-12-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2021-09-16
  • 2021-12-05
相关资源
相似解决方案