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


Fun(?) with DATETIME2


Fun(?) with DATETIME2

Author
Message
Tom Thomson
Tom Thomson
One Orange Chip
One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)

Group: General Forum Members
Points: 25705 Visits: 12494
Revenant (8/10/2011)
I logged that October 5-14, 1582, unaccounted-for gap as a bug against Windows. (SQL Server gets the weekday via a WinAPI call.)

I was told that this will be “soon” corrected for the cultures (languages) that were on the Roman calendar at that time. Win guys are not exactly sure what to do about countries that converted later; most notably Russian Orthodoxy, which converted only after the October Revolution of 1917. (What do you do if the date and time are marked as GMT but the culture is one of the Eastern Orthodoxies? Any suggestions for precedence of calculation?) [/quote
They are going to have real fun for Italy, which at the time was a bunch of city-states some of which converted in 1582 and some of which didn't. Also with Germany and bits of Austria (Holy Roman Empire) which converted piece-meal at later dates. And with the GB locale (different year numbers in different countries), the Netherlands, France, and Denmark. Even in the USA Texas converted to dates back when it was still Spanish, much of the rest of the USA rather later, and the Louisana Territory switched at yet another time. I guess the best they can do (unless they have the sense to do nothing) will be to cobble together some arbitrary meaningless mess which will offend various cultures quite seriously, and pretend they've done something useful.

[quote]This goes all the way back to The Bard and his oft-quoted “time is out of joint,” which alluded to the fact that when he wrote Hamlet, the English calendar was out of sync with the Roman one.
It goes back a long way before that. Some states used 1Jan as official year beginning from more than 300 years before Shakespeare, but the Roman official year never began then.

I guess this means that someone will have to think through comparisons of dates on servers that are set to different cultures. (The mentioned October Revolution, which was logged on October 25, 1917, is now celebrated on November 7.)

Never a dull moment.
Indeed not!

Tom

hardikssit1
hardikssit1
Mr or Mrs. 500
Mr or Mrs. 500 (592 reputation)Mr or Mrs. 500 (592 reputation)Mr or Mrs. 500 (592 reputation)Mr or Mrs. 500 (592 reputation)Mr or Mrs. 500 (592 reputation)Mr or Mrs. 500 (592 reputation)Mr or Mrs. 500 (592 reputation)Mr or Mrs. 500 (592 reputation)

Group: General Forum Members
Points: 592 Visits: 42
I am disagree with the correct answer of this query..
I got the following result after running the same in Msg window...

1752-09-09 00:00:00.0000000

I use "Microsoft SQL server 2008 R2", Please Explain....
Brandie Tarvin
Brandie Tarvin
SSC-Dedicated
SSC-Dedicated (37K reputation)SSC-Dedicated (37K reputation)SSC-Dedicated (37K reputation)SSC-Dedicated (37K reputation)SSC-Dedicated (37K reputation)SSC-Dedicated (37K reputation)SSC-Dedicated (37K reputation)SSC-Dedicated (37K reputation)

Group: General Forum Members
Points: 37109 Visits: 9268
hardikssit1 (9/28/2011)
I am disagree with the correct answer of this query..
I got the following result after running the same in Msg window...

1752-09-09 00:00:00.0000000

I use "Microsoft SQL server 2008 R2", Please Explain....


The explanation is in the answer to the question. This wasn't meant to be an uber-serious QOTD. It was meant as a fun little brain teaser. In certain calendars, the date doesn't technically exist. Which makes it even more interesting that MS says that it does.

Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
zymos
zymos
Right there with Babe
Right there with Babe (748 reputation)Right there with Babe (748 reputation)Right there with Babe (748 reputation)Right there with Babe (748 reputation)Right there with Babe (748 reputation)Right there with Babe (748 reputation)Right there with Babe (748 reputation)Right there with Babe (748 reputation)

Group: General Forum Members
Points: 748 Visits: 263
Great question on the DATETIME2 that supports larger precision times and date ranges.

Thanks.
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