Question

I am using Quartz.net scheduling framework. When I add a rule it uses TimeZoneInfo.Local to get the local time zone.

When I want to delete a rule for some reason it searches the time zone in system times zones by id, using:

TimeZoneInfo.FindSystemTimeZoneById 

Usually this works fine, but I have one client with windows server 2008R2, configured to be in Jerusalem standard time.

So in this case TimeZoneInfo.Local returns : "Jerusalem standard time" But this is not a key in the registry , it should be: "Israel Standard time" This causes the entire action to fail. What's up with that? That makes no sense to me...

Was it helpful?

Solution

The reason is because something is using the TimeZoneInfo.StandardName instead of the TimeZoneInfo.ID. For all timezones these values are identical, with the exception of 3 timezones, and "Jerusalem Standard Time" is one of those 3.

See the following link for the full explanation: Why are some time zones returned by GetSystemTimeZones not found by FindSystemTimeZoneById?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top