Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

UTC DST What Time is it?  T-SQL

Posted on 2009-07-14
4
Medium Priority
?
505 Views
Last Modified: 2012-05-07
I have a zipcode table with fields for UTC and DST.  UTC is stored as -8 etc and DST is stored as Y or N.

The users of the application place a lot of phone calls across the country and need to know what time it is in the various zips.  I need some code I can put in T-SQL/Stored Procedure that will tell me what time it is in the various zipcodes.  I will then incorporate that into my procedure.

Currently I have been doing a basic math from our timezone PST to the zipcodes time zone using the UTC field without thinking about DST.  Now that needs to change

Thanks
0
Comment
Question by:softdimensions
  • 2
  • 2
4 Comments
 
LVL 28

Expert Comment

by:strickdd
ID: 24852799
Not being familiar with the database myself and being given only the column names of "UTC" and "DST" along with values stored in the columns, my best bet is:

UTC: stores the timezone by standard notation of GMT +/- x. For example Eastern Standard Time is GMT -5 and therefore GMT -8 would be Pacific Time.

DST: stores whether or not that ZIP abbides by the daylight savings time standard or not. For example Muncie, IN does not use DST and would therefore by false for all of its ZIPs.

To get the time of the person you are calling you will first need to determine what the time is via the GMT +/- x, and then determine whether you need to accomodate for DST or not.
0
 

Author Comment

by:softdimensions
ID: 24852823
'and then determine whether you need to accomodate for DST or not.'

what are the parameters of the above.  The rest of your comments are entirely accurate.  Are the dates of DST standard across the USA?
0
 
LVL 28

Accepted Solution

by:
strickdd earned 2000 total points
ID: 24853151
Fun little website to help: http://www.webexhibits.org/daylightsaving/b.html

Daylight savings time is standard as to when it starts and ends in the United States, but in Europe the dates are different than the US, though they are consistent for European DST.
0
 

Author Comment

by:softdimensions
ID: 24853281
Thanks...that tip plus code from this website solved the problem
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question