Oracle 日期数据类型的范围:“公元前 4712 年 1 月 1 日至公元 9999 年 12 月 31 日”,该范围背后是否有任何逻辑?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3590404/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 21:23:48  来源:igfitidea点击:

Range for Oracle Date Data Type: "January 1, 4712 BC to December 31, 9999 AD", Does the range has any logic behind it?

sqloracle

提问by Charu

Range for Oracle Date Data Type: "January 1, 4712 BC to December 31, 9999 AD", Does the range has any logic behind it? I mean the range has any historic significance or it has something related to programming and memory size etc. I am just wondering, why only from January 1, 4712 BC to December 31, 9999 AD.

Oracle 日期数据类型的范围:“公元前 4712 年 1 月 1 日至公元 9999 年 12 月 31 日”,该范围背后是否有任何逻辑?我的意思是该范围具有任何历史意义,或者它与编程和内存大小等有关。我只是想知道,为什么只从公元前 4712 年 1 月 1 日到公元 9999 年 12 月 31 日。

采纳答案by Markus Winand

That's the Julian date?

那是朱利安约会?

http://en.wikipedia.org/wiki/Julian_day

http://en.wikipedia.org/wiki/Julian_day

Wikipedia says 4713, hmm...off by 1...

维基百科说 4713,嗯……减 1 分……

I guess the upper limit is just because of the 4 digits.

我猜上限只是因为 4 位数字。

Oracle doc says

甲骨文文档说

http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#i1847

http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#i1847

Julian dates allow continuous dating by the number of days from a common reference. (The reference is 01-01-4712 years BCE, so current dates are somewhere in the 2.4 million range.)

儒略日期允许根据共同参考的天数进行连续约会。(参考是公元前 01-01-4712 年,所以当前日期在 240 万年之间。)

EDIT

编辑

I guess the reason for 4712 instead of 4713 is that the conversion requires Y >= -4712:

我猜用 4712 而不是 4713 的原因是转换需要 Y >= -4712:

http://en.wikipedia.org/wiki/Julian_day#Converting_Julian_calendar_date_to_Julian_Day_Number

http://en.wikipedia.org/wiki/Julian_day#Converting_Julian_calendar_date_to_Julian_Day_Number

回答by Erhard Dinhobl

4712: have a look at julian day: http://en.wikipedia.org/wiki/Julian_day#Alternatives

4712:看看朱利安日:http: //en.wikipedia.org/wiki/Julian_day#Alternatives

9999: the highest value presented in 4 digits - at end of this year we will have another "milleniumbug"

9999:4位数的最高值——今年年底我们将迎来另一个“千年虫”

回答by djna

I suspect that it's set the upper limit for ease of formating to the highest 4 digit year, and then deduced the start of range by the capackity of the underlying type.

我怀疑它将易于格式化的上限设置为最高的 4 位年份,然后通过基础类型的容量推断范围的开始。