From 39001a600fcae2bcf27c225df8752d75fb92fef4 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期五, 31 十月 2025 11:18:26 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts
---
Main/Utility/TimeUtility.cs | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 52 insertions(+), 6 deletions(-)
diff --git a/Main/Utility/TimeUtility.cs b/Main/Utility/TimeUtility.cs
index 921fbb4..5889fb3 100644
--- a/Main/Utility/TimeUtility.cs
+++ b/Main/Utility/TimeUtility.cs
@@ -252,6 +252,31 @@
return StringUtility.Contact(hours.ToString("D2"), ":", mins.ToString("D2"), ":", seconds.ToString("D2"));
}
+
+ //璇︾粏鏄剧ず
+ //xx灏忔椂xx鍒哫X绉�
+ //xx鍒哫X绉�
+ //xx绉�
+ public static string SecondsToHMSEx(int _seconds)
+ {
+ int hours = _seconds % 86400 / 3600;
+ int mins = _seconds % 3600 / 60;
+ int seconds = _seconds % 60;
+ if (hours > 0)
+ {
+ return StringUtility.Contact(hours, Language.Get("L1072"), mins, Language.Get("L1073"), seconds, Language.Get("L1075"));
+ }
+ else if (mins > 0)
+ {
+ return StringUtility.Contact(mins, Language.Get("L1073"), seconds, Language.Get("L1075"));
+ }
+ else
+ {
+ return StringUtility.Contact(seconds, Language.Get("L1075"));
+ }
+ }
+
+
//渚嬪瓙锛涘垎锛氱
//xx:xx
public static string SecondsToMS(int _seconds)
@@ -345,8 +370,8 @@
}
//鏋佺畝鏄剧ず
- // x澶﹛灏忔椂
- // x灏忔椂x鍒�
+ // x澶� 鎴栬�� x澶﹛灏忔椂
+ // x灏忔椂 鎴栬�� x灏忔椂x鍒�
// x鍒�
// x绉�
public static string SecondsToShortDHMS(int _seconds)
@@ -357,10 +382,18 @@
int seconds = _seconds % 60;
if (days > 0)
{
+ if (hours == 0)
+ {
+ return StringUtility.Contact(days, Language.Get("L1074"));
+ }
return StringUtility.Contact(days, Language.Get("L1074"), hours, Language.Get("L1072"));
}
else if (hours > 0)
{
+ if (mins == 0)
+ {
+ return StringUtility.Contact(hours, Language.Get("L1072"));
+ }
return StringUtility.Contact(hours, Language.Get("L1072"), mins, Language.Get("L1073"));
}
else if (mins > 0)
@@ -387,10 +420,12 @@
}
return StringUtility.Contact(hours.ToString("D2"), ":", mins.ToString("D2"), ":", seconds.ToString("D2"));
}
+
+
//渚嬪瓙
//x澶�
//x鏃�
- //x鍒唜绉�
+ //x鍒�
//x绉�
public static string SecondsToConsumeRebate(int _seconds)
{
@@ -404,15 +439,15 @@
}
else if (hours >= 1)
{
- return StringUtility.Contact(Mathf.CeilToInt(hours), Language.Get("Hour"));
+ return StringUtility.Contact(Mathf.CeilToInt(hours), Language.Get("L1072"));
}
else if (mins >= 1)
{
- return StringUtility.Contact(mins, Language.Get("Minute"), seconds, Language.Get("RealmWin_Bewrite_35"));
+ return StringUtility.Contact(mins, Language.Get("L1073"));
}
else
{
- return StringUtility.Contact(seconds, Language.Get("RealmWin_Bewrite_35"));
+ return StringUtility.Contact(seconds, Language.Get("L1075"));
}
}
@@ -461,6 +496,17 @@
}
+ // 鍒�10鐐硅繕瑕佸灏戠锛屽鏋滃凡缁忚繃浜�10鐐癸紝杩斿洖0
+ public static int GetToTenClockSeconds()
+ {
+ var now = ServerNow;
+ if (now.Hour < 10)
+ {
+ return (int)(ServerNow - new DateTime(now.Year, now.Month, now.Day, 10, 0, 0)).TotalSeconds;
+ }
+ return 0;
+ }
+
//寮�鏈嶅ぉ缁撴潫鍊掕鏃讹紱鍗曚綅绉�
public static int GetRemindTimeByOpenDay(int days)
{
--
Gitblit v1.8.0