Solved

UTC DST What Time is it?  T-SQL

Posted on 2009-07-14
4
489 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
Comment Utility
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
Comment Utility
'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
Comment Utility
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
Comment Utility
Thanks...that tip plus code from this website solved the problem
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now