mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-07-02 08:38:13 +00:00
feat: TimeZone getting an invalid time zone now throws exception with time zone name
This commit is contained in:
parent
0490ffd572
commit
bb9bcf6cdf
1 changed files with 5 additions and 1 deletions
|
|
@ -61,7 +61,11 @@ namespace ICD.Common.Utils.TimeZoneInfo
|
|||
|
||||
public static IcdTimeZoneInfo FindSystemTimeZoneById(string timeZoneId)
|
||||
{
|
||||
return s_Cache[timeZoneId];
|
||||
IcdTimeZoneInfo timeZone;
|
||||
if (s_Cache.TryGetValue(timeZoneId, out timeZone))
|
||||
return timeZone;
|
||||
|
||||
throw new KeyNotFoundException(string.Format("Unable to find timezone with id:{0}", timeZoneId));
|
||||
}
|
||||
|
||||
public static bool TryFindSystemTimeZoneById(string timeZoneId, out IcdTimeZoneInfo output)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue