|
|
@@ -1,4 +1,5 @@
|
|
|
using System;
|
|
|
+using System.Runtime.InteropServices;
|
|
|
using System.Runtime.Serialization;
|
|
|
|
|
|
namespace OpenCards.Server.Core.Utils
|
|
|
@@ -491,7 +492,9 @@ namespace OpenCards.Server.Core.Utils
|
|
|
return utcTime;
|
|
|
}
|
|
|
|
|
|
- private static readonly TimeZoneInfo GameTimeZone = TimeZoneInfo.FindSystemTimeZoneById("China Standard Time");
|
|
|
+ private static readonly TimeZoneInfo GameTimeZone = RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
|
|
|
+ ? TimeZoneInfo.FindSystemTimeZoneById("China Standard Time")
|
|
|
+ : TimeZoneInfo.FindSystemTimeZoneById("Asia/Shanghai");
|
|
|
public static DateTime GetGameNow()
|
|
|
{
|
|
|
// 若需兼容 GM 调时:DateTime.UtcNow + TimeUtils.timeOffset 再转时区
|