mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
adjust server timezone
This commit is contained in:
@@ -58,12 +58,12 @@ internal readonly struct PlayerUid
|
||||
public TimeZoneInfo GetTimeZoneInfo()
|
||||
{
|
||||
// 美服 UTC-05
|
||||
// 欧服 UTC+02
|
||||
// 欧服 UTC+01
|
||||
// 其他 UTC+08
|
||||
return Region switch
|
||||
{
|
||||
"os_usa" => ServerTimeZoneInfo.UsaTimeZone,
|
||||
"os_euro" => ServerTimeZoneInfo.EuroTimeZone,
|
||||
"os_usa" => ServerTimeZoneInfo.AmericaTimeZone,
|
||||
"os_euro" => ServerTimeZoneInfo.EuropeTimeZone,
|
||||
_ => ServerTimeZoneInfo.CommonTimeZone,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5,13 +5,13 @@ namespace Snap.Hutao.Web.Hoyolab;
|
||||
|
||||
internal static class ServerTimeZoneInfo
|
||||
{
|
||||
private static readonly TimeZoneInfo UsaTimeZoneValue = TimeZoneInfo.CreateCustomTimeZone("Server:UTC-05", new TimeSpan(-05, 0, 0), "UTC-05", "UTC-05");
|
||||
private static readonly TimeZoneInfo EuroTimeZoneValue = TimeZoneInfo.CreateCustomTimeZone("Server:UTC+02", new TimeSpan(+02, 0, 0), "UTC+02", "UTC+02");
|
||||
private static readonly TimeZoneInfo AmericaTimeZoneValue = TimeZoneInfo.CreateCustomTimeZone("Server:UTC-05", new TimeSpan(-05, 0, 0), "UTC-05", "UTC-05");
|
||||
private static readonly TimeZoneInfo EuropeTimeZoneValue = TimeZoneInfo.CreateCustomTimeZone("Server:UTC+01", new TimeSpan(+01, 0, 0), "UTC+01", "UTC+01");
|
||||
private static readonly TimeZoneInfo CommonTimeZoneValue = TimeZoneInfo.CreateCustomTimeZone("Server:UTC+08", new TimeSpan(+08, 0, 0), "UTC+08", "UTC+08");
|
||||
|
||||
public static TimeZoneInfo UsaTimeZone { get => UsaTimeZoneValue; }
|
||||
public static TimeZoneInfo AmericaTimeZone { get => AmericaTimeZoneValue; }
|
||||
|
||||
public static TimeZoneInfo EuroTimeZone { get => EuroTimeZoneValue; }
|
||||
public static TimeZoneInfo EuropeTimeZone { get => EuropeTimeZoneValue; }
|
||||
|
||||
public static TimeZoneInfo CommonTimeZone { get => CommonTimeZoneValue; }
|
||||
}
|
||||
Reference in New Issue
Block a user