473,409 Members | 1,934 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

detect timezone & daylight saving time settings programmatically

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

Thanks

Bill
Nov 27 '06 #1
4 12422
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
Nov 27 '06 #2
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"
<bi*****************@jaco.comwrote:
>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
Nov 27 '06 #3
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" <mv*@promontis.nlwrote in message
news:11*********************@f16g2000cwb.googlegro ups.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

Nov 27 '06 #4
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:
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" <mv*@promontis.nlwrote in message
news:11*********************@f16g2000cwb.googlegro ups.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
Nov 28 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: mimmo | last post by:
I have a problem while calculating timezone (from Europe/Rome to Brazil/East). Can someone help me ?? Thank you, Mimmo. On this site http://www.timezoneconverter.com/cgi-bin/tzc.tzc I have...
3
by: Ilja Booij | last post by:
Hi all, I have some trouble with the following: I'm getting a time string, in YYYY-MM-DD HH:mm:ss format, which I need to translate into a string with DD-Mon-YYYY HH:mm:ss +HHMM, where the...
6
by: Bijoy Naick | last post by:
I have an events table which stores the time of each event - the time and assoicated timezone. Is there a way of converting this time into GMT (with support for DST).. some sort of function which...
13
by: Bruno Wolff III | last post by:
Recently there has been some discussion about attaching a timezone to a timestamp and some other discussion about including a 'day' part in the interval type. These two features impact each other,...
2
by: Michele Locati | last post by:
Hi to everybody I'm working with dates and time, and I can't find the way to determine the time in a generic TimeZone. Here's an example of what I'd like to do: // I get the local date and...
27
by: RobG | last post by:
I was investigating a function to determine whether daylight saving was being observed on a particular date (given the platform's regional settings) and came across a suggestion at merlyn.com to...
6
by: jehugaleahsa | last post by:
Hello: I would like it so that the time displayed was always for CDT/CDS. Potentially, the application can be run at locations in Mountain Time or Central Time. This is what I have now: //...
5
by: Ivan Velev | last post by:
Hello, Minimal example below - it gives me different output if I comment / uncomment the extra time.mktime call - note that this call is not related in any way to main logic flow. When...
4
by: Rohit | last post by:
I am trying to get client machine's timezone from my java script . But i have no idea how would i be able to get it in uclibc format. (e.g. GMT+0IST-1,M3.5.0/01:00:00,M10.5.0/02:00:00) . I saw...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.