Bobson
Bobson

Reputation: 13706

Determining whether a timezone supports Daylight Savings Time

The TimeZoneInfo.IsDaylightSavingTime() method supports determining whether a given time is in DST or not, but I can't find anything which will tell me whether a given timezone supports it at all. Is there any such thing?

Specifically, I need to write code which sends a different flag depending on whether the user's timezone is one that observes DST, regardless of whether it's currently in DST or not.

Upvotes: 3

Views: 272

Answers (1)

Thomas Levesque
Thomas Levesque

Reputation: 292465

You can use the TimeZoneInfo.SupportsDaylightSavingTime property:

TimeZoneInfo tzi = ...
if (tzi.SupportsDaylightSavingTime)
{
    ...
}

Upvotes: 5

Related Questions