Reputation: 12868
Is there a way in VB.Net to determine if the timezone the current system has daylight savings time in effect? Of course I can get the offset from GMT using the "z"/"zz" formatting option, but that doesn't tell me if DST is in effect for the current timezone or if the current timezone is in standard time...or if DST/Standard time aren't even an issue in the timezone for the system. Does that make sense?
Upvotes: 4
Views: 7774
Reputation: 41
Just use Now.IsDaylightSavingTime
. It returns a boolean value.
Stephen B. Craver
Upvotes: 4
Reputation: 12868
I'm sure the answers provided would work...I just couldn't figure out how to get them working however. There is no "IsDaylightSavingTime" method available to me. I ended up using:
TimeZoneInfo.Local.DaylightName
Upvotes: 1
Reputation: 26174
You can use for dateinstance:
DateTimeInstance.IsDaylightSavingTime()
Upvotes: 3