GregH
GregH

Reputation: 12868

Is there a call in vb.net I can make to determine daylight savings time?

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

Answers (4)

Stephen B Craver
Stephen B Craver

Reputation: 41

Just use Now.IsDaylightSavingTime. It returns a boolean value.

Stephen B. Craver

Upvotes: 4

GregH
GregH

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

Nakul Chaudhary
Nakul Chaudhary

Reputation: 26174

You can use for dateinstance:

DateTimeInstance.IsDaylightSavingTime()

Upvotes: 3

Related Questions