Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQLServerCentral.com
»
Articles Requested
»
Time Zone Conversions
Time Zone Conversions
Rate Topic
Display Mode
Topic Options
Author
Message
Steve Jones - SSC Editor
Steve Jones - SSC Editor
Posted Tuesday, July 10, 2012 10:39 AM
SSC-Dedicated
Group: Administrators
Last Login: 2 days ago @ 1:47 PM
Points: 31,406,
Visits: 13,722
Looking for an article that talks about and shows how to easily convert one time to another given a time zone. It would be nice if the standard EST/EDT/CST/CDT/PST/GMT, etc codes could be used to convert times easily.
Follow me on Twitter:
@way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
Post #1327759
GSquared
GSquared
Posted Tuesday, July 10, 2012 11:14 AM
SSCoach
Group: General Forum Members
Last Login: Monday, May 06, 2013 1:09 PM
Points: 15,439,
Visits: 9,569
Should the code be sensitive to Daylight Time vs Standard Time (US), or should it rely on "EDT" vs "EST" in the input?
If sensitive without the input being modified, should it take into account prior definitions of the begin/end dates for those transitions, or just work off of current rules?
Will it take a location into account (like Arizona, which doesn't do Daylight Time; same for Hawaii)?
Or just 3 inputs: Time, ZoneFrom, ZoneTo?
How about backwards compatibily with SQL Server 2005 and before, which don't have the Time datatype, and would have to provide DateTime?
Or, since it's an article, should it go into all of these options, and provide sample code for each? The more complex options (geo-sensitive, sensitive to changing rules by year of input value, etc.) might be pretty complex.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Post #1327776
Steve Jones - SSC Editor
Steve Jones - SSC Editor
Posted Tuesday, July 10, 2012 11:31 AM
SSC-Dedicated
Group: Administrators
Last Login: 2 days ago @ 1:47 PM
Points: 31,406,
Visits: 13,722
GSquared (7/10/2012)
Should the code be sensitive to Daylight Time vs Standard Time (US), or should it rely on "EDT" vs "EST" in the input?
If sensitive without the input being modified, should it take into account prior definitions of the begin/end dates for those transitions, or just work off of current rules?
Will it take a location into account (like Arizona, which doesn't do Daylight Time; same for Hawaii)?
Or just 3 inputs: Time, ZoneFrom, ZoneTo?
How about backwards compatibily with SQL Server 2005 and before, which don't have the Time datatype, and would have to provide DateTime?
Or, since it's an article, should it go into all of these options, and provide sample code for each? The more complex options (geo-sensitive, sensitive to changing rules by year of input value, etc.) might be pretty complex.
I think this will be a bit complex. Yes, I'd like to take into account the EST v EDT. I don't know that I'd go back in time to the old DST time changes (Apr/Oct) but work with new ones.
No backwards compatability with pre 2008.
Sample code, and a function to use. If there's something that can't be covered or seems out of scope, say that.
Follow me on Twitter:
@way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
Post #1327785
GSquared
GSquared
Posted Tuesday, July 10, 2012 11:51 AM
SSCoach
Group: General Forum Members
Last Login: Monday, May 06, 2013 1:09 PM
Points: 15,439,
Visits: 9,569
Happen to know where to get a list of all the time-zone abbreviations? I tried a quick search online, including a couple of wikipedia articles, and couldn't get anything other than the statement that "Local abbreviations like EST and PDT are not part of any international standard and shouldn't be used".
The US ones are easy. Could also provide a framework that allows entering localized versions and avoid that whole thing. Would that do for what you want the article to cover?
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Post #1327792
Steve Jones - SSC Editor
Steve Jones - SSC Editor
Posted Tuesday, July 10, 2012 1:26 PM
SSC-Dedicated
Group: Administrators
Last Login: 2 days ago @ 1:47 PM
Points: 31,406,
Visits: 13,722
This work?
http://www.timeanddate.com/library/abbreviations/timezones/
A framework would be nice.
Looking to fill a hole, or a partial hole, in dealing with time zones in T-SQL.
Follow me on Twitter:
@way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
Post #1327846
GSquared
GSquared
Posted Monday, July 16, 2012 8:31 AM
SSCoach
Group: General Forum Members
Last Login: Monday, May 06, 2013 1:09 PM
Points: 15,439,
Visits: 9,569
Article and script (for the data) sent (by e-mail).
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Post #1330148
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.