SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


DateTime Functions


DateTime Functions

Author
Message
OzYbOi d(-_-)b
OzYbOi d(-_-)b
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2370 Visits: 778
good question - cheers
yannick.dinger
yannick.dinger
SSC-Enthusiastic
SSC-Enthusiastic (124 reputation)SSC-Enthusiastic (124 reputation)SSC-Enthusiastic (124 reputation)SSC-Enthusiastic (124 reputation)SSC-Enthusiastic (124 reputation)SSC-Enthusiastic (124 reputation)SSC-Enthusiastic (124 reputation)SSC-Enthusiastic (124 reputation)

Group: General Forum Members
Points: 124 Visits: 50
learn something new today :-)
EL Jerry
EL Jerry
SSCertifiable
SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)

Group: General Forum Members
Points: 5091 Visits: 1346
Good question, Steve. I like this kind of questions where I have to read and learn new things.

"El" Jerry.

"El" Jerry.

"A watt of Ottawa" - Gerardo Galvan

To better understand your help request, please follow these best practices.
mtassin
mtassin
SSChampion
SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)

Group: General Forum Members
Points: 13232 Visits: 72528
Thanks for an easy one.

I personally love this data type... it makes dealing with multi-time zone data a little bit easier.... datetime data still gives me more headaches than any other.

"Ok Ms. Smith we'll schedule a callback at 3pm your time in California on Friday"

Ok so she's in a portion of California that doens't follow DST, we're in Chicago and we do.

Is Friday in or out of DST? Do we know her correct TZ? What about when our east coast support team decides to handle this one?

*sigh*

Headaches I tell you... Smile



--Mark Tassin
MCITP - SQL Server DBA
Proud member of the Anti-RBAR alliance.
For help with Performance click this link
For tips on how to post your problems
Steve Jones
Steve Jones
SSC Guru
SSC Guru (327K reputation)SSC Guru (327K reputation)SSC Guru (327K reputation)SSC Guru (327K reputation)SSC Guru (327K reputation)SSC Guru (327K reputation)SSC Guru (327K reputation)SSC Guru (327K reputation)

Group: Administrators
Points: 327975 Visits: 20104
Glad you liked this one. It was one that taught me something when I wrote it.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Ken Wymore
Ken Wymore
SSCrazy Eights
SSCrazy Eights (9.6K reputation)SSCrazy Eights (9.6K reputation)SSCrazy Eights (9.6K reputation)SSCrazy Eights (9.6K reputation)SSCrazy Eights (9.6K reputation)SSCrazy Eights (9.6K reputation)SSCrazy Eights (9.6K reputation)SSCrazy Eights (9.6K reputation)

Group: General Forum Members
Points: 9588 Visits: 2469
Nice question Steve, learned something new today.
Tom Thomson
Tom Thomson
SSC Guru
SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)SSC Guru (50K reputation)

Group: General Forum Members
Points: 50455 Visits: 13157
mtassin (4/5/2012)
Thanks for an easy one.

I personally love this data type... it makes dealing with multi-time zone data a little bit easier.... datetime data still gives me more headaches than any other.

"Ok Ms. Smith we'll schedule a callback at 3pm your time in California on Friday"

Ok so she's in a portion of California that doens't follow DST, we're in Chicago and we do.

Is Friday in or out of DST? Do we know her correct TZ? What about when our east coast support team decides to handle this one?

*sigh*

Headaches I tell you... Smile

+1 on that. I wish I'd had this data type and this function years back. We had customers in 4 time zones raging from +05:30 to -06:00.

Tom

wodom
wodom
SSCommitted
SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)SSCommitted (1.9K reputation)

Group: General Forum Members
Points: 1864 Visits: 265
Something seems contradictory in the answer to this question. First it says the answer is 2012/04/05 11:00:00 +05:00. Then in the explanation it says the GMT time of the result is 2012/04/05 11:00 (in other words, the answer is 2012/04/05 11:00 +00.00).

Well those two times are 5 hours apart, so they both can't be right.



Britt Cluff
Britt Cluff
Hall of Fame
Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)

Group: General Forum Members
Points: 3291 Visits: 253
Good straightforward question. Thanks for submitting.

http://brittcluff.blogspot.com/
Chris Umbaugh
Chris Umbaugh
Right there with Babe
Right there with Babe (732 reputation)Right there with Babe (732 reputation)Right there with Babe (732 reputation)Right there with Babe (732 reputation)Right there with Babe (732 reputation)Right there with Babe (732 reputation)Right there with Babe (732 reputation)Right there with Babe (732 reputation)

Group: General Forum Members
Points: 732 Visits: 241
Good question. Never used this data type before but I have a project coming my way soon where I may be able to leverage datetimeoffset. Very "timely" har har. Thanks.

Chris Umbaugh
Data Warehouse / Business Intelligence Consultant
twitter @ToledoSQL
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search