From 3cc0a9bef2cefdcae53f3cfd99d9d46ffa7e7833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Fri, 19 Nov 2021 11:25:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- function.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/function.php b/function.php index 39d52582..838923fc 100644 --- a/function.php +++ b/function.php @@ -156,9 +156,11 @@ if (!function_exists('now')) { */ function now(): string { - $sprintf = sprintf('%04d', microtime(true)); + $replace = str_replace(time() . '.', '', (string)microtime(true)); - return date('Y-m-d H:i:s') . '.' . str_replace(time() . '.', '', $sprintf); + $sprintf = sprintf('%04d', $replace); + + return date('Y-m-d H:i:s') . '.' . $sprintf; } }