C# TimeZoneNotFoundException
Program.cs
Output
kodingwindow@kw:~/csharp$ dotnet runUnhandled exception. System.TimeZoneNotFoundException: The time zone ID 'IndiaIndia Standard Time' was not found on the local computer. ---> System.TimeZoneNotFoundException: The time zone ID 'IndiaIndia Standard Time' is invalid. --- End of inner exception stack trace --- at System.TimeZoneInfo.FindSystemTimeZoneById(String id) at Program.<Main>$(String[] args) in /home/kodingwindow/csharp/Program.cs:line 1 kodingwindow@kw:~/csharp$
C# program to handle the TimeZoneNotFoundException
Program.cs
Output
kodingwindow@kw:~/csharp$ dotnet run The time zone ID 'IndiaIndia Standard Time' was not found on the local computer. List of correct time zone IDs Dateline Standard Time Hawaiian Standard Time Marquesas Standard Time Alaskan Standard Time ... Pacific/Fakaofo Pacific/Tongatapu Pacific/Kiritimati kodingwindow@kw:~/csharp$
Advertisement