php date(‘Y-m-d H:i:s‘)指定时间转成毫秒时间戳

// 指定时间转成毫秒时间戳
function get_data_format($time)
{
    list($usec, $sec) = explode(".", $time);
    $date = strtotime($usec);
    $last_login_time = str_pad($date.$sec,13,"0",STR_PAD_RIGHT); //不足13位。右边补0
    return $last_login_time;
}

猜你喜欢

转载自blog.csdn.net/weixin_42021688/article/details/108642316