473,387 Members | 1,760 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,387 software developers and data experts.

Calculating daylight saving time automatically

Hi guys,

I have to make a event signup page for our company that would display
the event time/date in 3 different time zones (Eastern - New York,
Central - Chicago, and Pacific - San Francisco). To do this. I convert
the inputed date from local time zone and convert it into UTC and store
it in the database (correct me if I'm wrong please). Next to display it
I would add the correct time zone difference value (-5 for Eastern).
How to do I handle the daylight saving time though? For example the -5
Eastern time is right now -4. Is there a way to do this automatically?
Any samples would be greatly appreciated.
Thanks
M.

Oct 13 '06 #1
2 3045
I believe Windows does keep track of whether daylight saving time is in
effect in its location.

<ma*******@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
Hi guys,

I have to make a event signup page for our company that would display
the event time/date in 3 different time zones (Eastern - New York,
Central - Chicago, and Pacific - San Francisco). To do this. I convert
the inputed date from local time zone and convert it into UTC and store
it in the database (correct me if I'm wrong please). Next to display it
I would add the correct time zone difference value (-5 for Eastern).
How to do I handle the daylight saving time though? For example the -5
Eastern time is right now -4. Is there a way to do this automatically?
Any samples would be greatly appreciated.
Thanks
M.

Oct 13 '06 #2
ma*******@gmail.com wrote:
Hi guys,

I have to make a event signup page for our company that would display
the event time/date in 3 different time zones (Eastern - New York,
Central - Chicago, and Pacific - San Francisco). To do this. I convert
the inputed date from local time zone and convert it into UTC and store
it in the database (correct me if I'm wrong please). Next to display it
I would add the correct time zone difference value (-5 for Eastern).
How to do I handle the daylight saving time though? For example the -5
Eastern time is right now -4. Is there a way to do this automatically?
Any samples would be greatly appreciated.
You shouldn't have to do any calculations at all. If you use
DateTime.ToUniversalTime and DateTime.ToLocalTime, it should take
Daylight Savings into account automatically and return the correct
values.

Oct 16 '06 #3

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

Similar topics

14
by: Amitabh Deepak | last post by:
Is there any way to check whether daylight saving is enabled on a linux machine?
1
by: Drew | last post by:
Is there a way to check if it is daylight savings or not via c#? I have heard you can use System.Globalization? Thanks - Drew
7
by: Brett Edman | last post by:
I created a UTC clock using this: UTCTime = MyTime.ToUniversalTime() Now that we've turned the clocks ahead 1 hour for daylight savings time, the clock is reporting the wrong UTC time. It is...
1
by: mazdotnet | last post by:
Hi guys, I have to make a event signup page for our company that would display the event time/date in 3 different time zones (Eastern - New York, Central - Chicago, and Pacific - San Francisco)....
2
by: maflatoun | last post by:
Hi guys, I have to make a event signup page for our company that would display the event time/date in 3 different time zones (Eastern - New York, Central - Chicago, and Pacific - San Francisco)....
1
by: maflatoun | last post by:
Hi everyone, I have 3 different time zones that I'm working with. Basically converting from UTC to those 3 time zones. Eastern Daylight Time (GMT -04:00, New York) Central Daylight Time (GMT...
1
by: maflatoun | last post by:
Hi everyone, I have 3 different time zones that I'm working with. Basically converting from UTC to those 3 time zones. Eastern Daylight Time (GMT -04:00, New York) Central Daylight Time (GMT...
4
by: Bill Nguyen | last post by:
How can I detect timezone and whether daylight saving is applied on a client PC/server using VB.NET? Thanks Bill
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.