Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

UTC DST What Time is it?  T-SQL

Posted on 2009-07-14
4
Medium Priority
?
500 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 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

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

715 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