Home All Groups Group Topic Archive Search About

detect timezone & daylight saving time settings programmatically

Author
27 Nov 2006 8:00 PM
Bill Nguyen
How can I detect timezone and whether daylight saving is applied on a client
PC/server using VB.NET?

Thanks

Bill

Author
27 Nov 2006 8:46 PM
Rad [Visual C# MVP]
Hey Bill,

Check out the System.Timezone class. If that doesn't have what you
need, a chap called Michael Brumm has extended it to add some
functionality - http://www.michaelbrumm.com/simpletimezone.html

On Mon, 27 Nov 2006 12:00:02 -0800, "Bill Nguyen"
<billn_nospam_please@jaco.com> wrote:

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

Bits.Bytes.
http://bytes.thinkersroom.com
Author
27 Nov 2006 8:47 PM
Michel van den Berg
Dim t As TimeZone = System.TimeZone.CurrentTimeZone
Dim dls as boolean = t.IsDaylightSavingTime(Now)

Bill Nguyen schreef:

Show quoteHide quote
> How can I detect timezone and whether daylight saving is applied on a client
> PC/server using VB.NET?
>
> Thanks
>
> Bill
Author
27 Nov 2006 9:26 PM
Bill Nguyen
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

Show quoteHide quote
"Michel van den Berg" <m**@promontis.nl> wrote in message
news:1164660477.611746.23210@f16g2000cwb.googlegroups.com...
> Dim t As TimeZone = System.TimeZone.CurrentTimeZone
> Dim dls as boolean = t.IsDaylightSavingTime(Now)
>
> Bill Nguyen schreef:
>
>> How can I detect timezone and whether daylight saving is applied on a
>> client
>> PC/server using VB.NET?
>>
>> Thanks
>>
>> Bill
>
Author
28 Nov 2006 5:45 PM
Michel van den Berg
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:

Show quoteHide quote
> 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
>
> "Michel van den Berg" <m**@promontis.nl> wrote in message
> news:1164660477.611746.23210@f16g2000cwb.googlegroups.com...
> > Dim t As TimeZone = System.TimeZone.CurrentTimeZone
> > Dim dls as boolean = t.IsDaylightSavingTime(Now)
> >
> > Bill Nguyen schreef:
> >
> >> How can I detect timezone and whether daylight saving is applied on a
> >> client
> >> PC/server using VB.NET?
> >>
> >> Thanks
> >>
> >> Bill
> >