Solved

UTC DST What Time is it?  T-SQL

Posted on 2009-07-14
4
498 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 500 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

624 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