Solved

UTC DST What Time is it?  T-SQL

Posted on 2009-07-14
4
491 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 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help Parsing a String with SQL Syntax 23 42
Email Notifications for SQL 2005 9 27
sql server computed columns 11 29
Mysql Left Join Case 10 41
by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

815 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