In my local computer i am trying to access the offset values of IANA timezone using the converter
as follows,
foreach (var timeZone in TZConvert.KnownIanaTimeZoneNames)
{
var tzi = TZConvert.GetTimeZoneInfo(timeZone.ToString());
TimeSpan offset = tzi.GetUtcOffset(DateTime.Now);
.......
}
the line TZConvert.GetTimeZoneInfo(timeZone.ToString())
sometimes throw an error saying
System.TimeZoneNotFoundException: 'The time zone ID 'Sudan Standard Time' was not found on the local computer.'
when i try the same on power shell with the same command,
PS C:\Users\SajeetharanS> [System.TimeZoneInfo]::FindSystemTimeZoneById("Aleutian Standard Time") Exception calling "FindSystemTimeZoneById" with "1" argument(s): "The time zone ID 'Aleutian Standard Time' was not found on the local computer." At line:1 char:1 + [System.TimeZoneInfo]::FindSystemTimeZoneById("Aleutian Standard Time ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : TimeZoneNotFoundException
why some timezone information are missing? how can i fix it?