From c1aa2626bc24b97546e576f6b5f450c2778e82a7 Mon Sep 17 00:00:00 2001 From: guowei Date: Mon, 18 Jan 2021 11:07:07 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=B7=85=E5=B3=B0=E8=B5=9B=E5=A4=B4?= =?UTF-8?q?=E5=83=8F=E6=A1=86=E4=BF=AE=E6=94=B9=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/ManagedResources/~Lua/Common/functions.lua | 5 +++++ .../~Lua/Modules/Setting/HeadChangePopup.lua | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Assets/ManagedResources/~Lua/Common/functions.lua b/Assets/ManagedResources/~Lua/Common/functions.lua index 2485b4ba73..d5c5cb6ef0 100644 --- a/Assets/ManagedResources/~Lua/Common/functions.lua +++ b/Assets/ManagedResources/~Lua/Common/functions.lua @@ -1371,6 +1371,11 @@ function TimeStampToDateStr(timestamp) end return string.format(Language[12119], date.year, date.month, date.day, date.hour, date.min) end +function TimeStampToDateStr2(timestamp) + local date = os.date("*t", timestamp) + local cdate = os.date("*t", GetTimeStamp()) + return string.format(Language[12119], date.year, date.month, date.day, date.hour, date.min) +end -- 将时间戳转换为用于显示的日期字符串(时分秒) function TimeStampToDateStr3(second) local minute = math.floor(second / 60) % 60 diff --git a/Assets/ManagedResources/~Lua/Modules/Setting/HeadChangePopup.lua b/Assets/ManagedResources/~Lua/Modules/Setting/HeadChangePopup.lua index d95524e85a..a58cfa2a3a 100644 --- a/Assets/ManagedResources/~Lua/Modules/Setting/HeadChangePopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/Setting/HeadChangePopup.lua @@ -315,7 +315,7 @@ function this.SelectItem(index, item) if not data then return end if data.Id >=80000 and HeadData and HeadData.validTime - GetTimeStamp() > 0 then -- body - this.content.text = data.ItemDescribe .."到期时间:"..TimeStampToDateStr(HeadData.validTime) + this.content.text = data.ItemDescribe .."到期时间:"..TimeStampToDateStr2(HeadData.validTime) else this.content.text = data.ItemDescribe end