adjust server timezone

This commit is contained in:
DismissedLight
2023-11-09 23:15:08 +08:00
parent 3005031b39
commit cfff6f39fc
2 changed files with 7 additions and 7 deletions

View File

@@ -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,
};
}

View File

@@ -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; }
}