* Date: 2024-03-13 15:11 */ if (!function_exists('datetime')) { /** * Generate the URL to a named route. * * @param null $time * @return string */ function datetime($time = null): string { $time = $time ?: time(); return date("Y-m-d H:i:s", (int)$time); } } if (!function_exists('getMillisecond')) { /** * Notes:获取毫秒 * @return string */ function getMillisecond(): string { list($s1, $s2) = explode(' ', microtime()); return sprintf('%.0f', (floatval($s1) + floatval($s2)) * 1000); } }