From ecb77c8dc895797a781389168648ee7b98eb98ed Mon Sep 17 00:00:00 2001 From: Default User Date: Thu, 15 Jan 2026 11:57:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=A0=BC=E5=BC=8F=EF=BC=8C=E7=A1=AE=E4=BF=9D=E6=89=80?= =?UTF-8?q?=E6=9C=89=E6=97=A5=E5=BF=97=E4=BD=BF=E7=94=A8=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E7=9A=84yyyy-MM-dd=20HH:mm:ss=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/goods-update/goods-update.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pages/goods-update/goods-update.js b/pages/goods-update/goods-update.js index b4a3268..54bfb2b 100644 --- a/pages/goods-update/goods-update.js +++ b/pages/goods-update/goods-update.js @@ -1295,8 +1295,15 @@ Page({ console.log('【saveEdit】获取用户名异常,使用默认operatorName:', operatorName); } - // 获取当前时间 - const currentTime = new Date().toLocaleString('zh-CN'); + // 获取当前时间并格式化为统一格式:yyyy-MM-dd HH:mm:ss + const now = new Date(); + const year = now.getFullYear(); + const month = (now.getMonth() + 1).toString().padStart(2, '0'); + const day = now.getDate().toString().padStart(2, '0'); + const hours = now.getHours().toString().padStart(2, '0'); + const minutes = now.getMinutes().toString().padStart(2, '0'); + const seconds = now.getSeconds().toString().padStart(2, '0'); + const currentTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; // 获取当前产品日志 let productLog = [];