问题描述
为什么选择1753?他们反对1752?我的伟大伟大的伟大伟大的伟大的祖父将被非常冒犯。决定使用1753年1月1日( 1753-01-01
),因为SQL Server中的日期时间的最小日期值可以追溯到其Sybase起源。
日期本身的意义可归因于这个人。
Philip Stanhope,切斯特菲尔德第四伯爵。谁通过英国议会指导了。这是为了通过英国及其后殖民地的公历。
有一些。 1752年9月3日至1752年9月13日失踪。
Kalen Delaney 这样选择
1753的选择似乎有点偏心,但)。相反,很多国家直到1918年俄罗斯才改革了他们的日历。事实上,1917年的十月革命始于11月7日在公历前。
datetime
和新的 datetime2
不要试图解释这些本地的差异,只需使用公历。
所以随着更大的范围 datetime2
SELECT CONVERT(VARCHAR,DATEADD(DAY, 5,CAST('1752-09-13'AS DATETIME2)),100)
p>
9月8日1752 12:00 AM
数据类型 datetime2
的最后一点是使用在实际发明之前向后倾斜,所以我们是有限的e处理历史日期。
与其他软件实现(如Java 类,默认为遵循朱利安日历,直到1582年10月4日,然后跳跃到1582年10月15日在新的公历。在该日期之前,它正确地处理了闰年的朱利安模式,以及该日期后的格里高利模式。调用者可以通过调用 setGregorianChange()
来更改切换日期。
一篇相当有趣的文章,讨论采用日历的一些更特殊的内容。
Why 1753? What do they have against 1752? My great great great great great great great grandfather would be very offended.
The decision to use 1st January 1753 (1753-01-01
) as the minimum date value for a datetime in SQL Server goes back to its Sybase origins.
The significance of the date itself though can be attributed to this man.
Philip Stanhope, 4th Earl of Chesterfield. Who steered the Calendar (New Style) Act 1750 through the British Parliament. This legislated for the adoption of the Gregorian calendar for Britain and its then colonies.
There were some missing days in the British calendar in 1752 when the adjustment was finally made from the Julian calendar. September 3, 1752 to September 13, 1752 were lost.
Kalen Delaney explained the choice this way
The choice of 1753 does seem somewhat anglocentric however as many catholic countries in Europe had been using the calendar for 170 years before the British implementation (originally delayed due to opposition by the church). Conversely many countries did not reform their calendars until much later, 1918 in Russia. Indeed the October Revolution of 1917 started on 7 November under the Gregorian calendar.
Both datetime
and the new datetime2
datatype mentioned in Joe's answer do not attempt to account for these local differences and simply use the Gregorian Calendar.
So with the greater range of datetime2
SELECT CONVERT(VARCHAR, DATEADD(DAY,-5,CAST('1752-09-13' AS DATETIME2)),100)
Returns
Sep 8 1752 12:00AM
One final point with the datetime2
data type is that it uses the proleptic Gregorian calendar projected backwards to well before it was actually invented so is of limited use in dealing with historic dates.
This contrasts with other Software implementations such as the Java Gregorian Calendar class which defaults to following the Julian Calendar for dates until October 4, 1582 then jumping to October 15, 1582 in the new Gregorian calendar. It correctly handles the Julian model of leap year before that date and the Gregorian model after that date. The cutover date may be changed by the caller by calling setGregorianChange()
.
A fairly entertaining article discussing some more peculiarities with the adoption of the calendar can be found here.
这篇关于SQL Server中的1/1/1753有什么意义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!