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:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top