/**
* 获取当前日期带毫秒
* @return string
*/
function ts_time() {
date_default_timezone_set('PRC');
$mtimestamp = sprintf("%.3f", microtime(true)); // 带毫秒的时间戳
$timestamp = floor($mtimestamp); // 时间戳
$milliseconds = round(($mtimestamp - $timestamp) * 1000); // 毫秒
$datetime = date("Y-m-d H:i:s", $timestamp) . '.' . $milliseconds;
return $datetime;// 2018-04-16 13:26:14.820
}
暂无评论