detect timezone & daylight saving time settings programmatically

  • Thread starter Thread starter Bill Nguyen
  • Start date Start date
B

Bill Nguyen

How can I detect timezone and whether daylight saving is applied on a client
PC/server using VB.NET?

Thanks

Bill
 
Dim t As TimeZone = System.TimeZone.CurrentTimeZone
Dim dls as boolean = t.IsDaylightSavingTime(Now)

Bill Nguyen schreef:
 
Thanks Michel and Rad.

tz.getUtcOffset.totalHours works great!

One quick question: Do I really need to worry about saving time at all or
..getUtcOffset will detect it automatically?

Thanks again

Bill
 
Your pc clock will auto update daylightsaving if needed. So IMO it will
detect it automatically. Do keep in mind, that if you have multiple
apps running on different pc's, time settings could be different.

Bill Nguyen schreef:
 
Back
Top