diff --git a/CompatBot/Utils/TimeParser.cs b/CompatBot/Utils/TimeParser.cs index d7d80225..475ac82a 100644 --- a/CompatBot/Utils/TimeParser.cs +++ b/CompatBot/Utils/TimeParser.cs @@ -10,14 +10,14 @@ namespace CompatBot.Utils public static readonly Dictionary TimeZoneAcronyms = new Dictionary { - ["PT"] = new[] { "Pacific Standard Time" }, - ["PST"] = new[] { "Pacific Standard Time" }, - ["PDT"] = new[] { "Pacific Standard Time" }, - ["EST"] = new[] { "Eastern Standard Time" }, - ["EDT"] = new[] { "Eastern Standard Time" }, - ["CEST"] = new[] { "Central European Standard Time" }, - ["BST"] = new[] { "British Summer Time", "GMT Standard Time" }, - ["JST"] = new[] { "Japan Standard Time", "Tokyo Standard Time" }, + ["PT"] = new[] { "Pacific Standard Time", "America/Los_Angeles" }, + ["PST"] = new[] { "Pacific Standard Time", "America/Los_Angeles" }, + ["PDT"] = new[] { "Pacific Standard Time", "Pacific Daylight Time", "America/Los_Angeles" }, + ["EST"] = new[] { "Eastern Standard Time", "America/New_York" }, + ["EDT"] = new[] { "Eastern Standard Time", "Eastern Daylight Time", "America/New_York" }, + ["CEST"] = new[] { "Central European Standard Time", "Europe/Berlin" }, + ["BST"] = new[] { "British Summer Time", "GMT Standard Time", "Europe/London" }, + ["JST"] = new[] { "Japan Standard Time", "Tokyo Standard Time", "Asia/Tokyo" }, }; static TimeParser() @@ -28,25 +28,25 @@ namespace CompatBot.Utils select tzn, StringComparer.InvariantCultureIgnoreCase ); - Config.Log.Debug("[TZI] Unique TZA names: " + uniqueNames.Count); + Config.Log.Trace("[TZI] Unique TZA names: " + uniqueNames.Count); var tzList = TimeZoneInfo.GetSystemTimeZones(); - Config.Log.Debug("[TZI] System TZI count: " + tzList.Count); + Config.Log.Trace("[TZI] System TZI count: " + tzList.Count); var result = new Dictionary(); foreach (var tzi in tzList) { - Config.Log.Debug($"[TZI] Checking {tzi.Id} ({tzi.DisplayName} / {tzi.StandardName} / {tzi.DaylightName})"); - if (uniqueNames.Contains(tzi.StandardName) || uniqueNames.Contains(tzi.DaylightName) || uniqueNames.Contains(tzi.DisplayName)) + Config.Log.Trace($"[TZI] Checking {tzi.Id} ({tzi.DisplayName} / {tzi.StandardName} / {tzi.DaylightName})"); + if (uniqueNames.Contains(tzi.StandardName) || uniqueNames.Contains(tzi.DaylightName) || uniqueNames.Contains(tzi.Id)) { - Config.Log.Debug("[TZI] Looks like it's a match!"); + Config.Log.Trace("[TZI] Looks like it's a match!"); var acronyms = from tza in TimeZoneAcronyms - where tza.Value.Contains(tzi.StandardName) || tza.Value.Contains(tzi.DaylightName) || tza.Value.Contains(tzi.DisplayName) + where tza.Value.Contains(tzi.StandardName) || tza.Value.Contains(tzi.DaylightName) || tza.Value.Contains(tzi.Id) select tza.Key; - Config.Log.Debug("[TZI] Matched acronyms: " + string.Join(", ", acronyms)); + Config.Log.Trace("[TZI] Matched acronyms: " + string.Join(", ", acronyms)); foreach (var tza in acronyms) result[tza] = tzi; } } - Config.Log.Debug("[TZI] Total matched acronyms: " + result.Count); + Config.Log.Trace("[TZI] Total matched acronyms: " + result.Count); TimeZoneMap = result; }