oracle 甲骨文日期
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/187474/
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
Oracle date
提问by Igor Drincic
How is Oracle date implemented? Is it stored as milliseconds or something like that?
Oracle 日期是如何实现的?它是存储为毫秒还是类似的东西?
回答by Justin Cave
An Oracle DATE stores the date and time to the second. An Oracle TIMESTAMP stores the date and time to up to 9 digits of subsecond precision, depending on the available hardware.
Oracle DATE 将日期和时间存储到秒。Oracle TIMESTAMP 将日期和时间存储为最多 9 位亚秒级精度,具体取决于可用硬件。
Both are implemented by storing the various components of the date and the time in a packed binary format. From the Oracle Concepts Guide section on dates
两者都是通过以打包的二进制格式存储日期和时间的各种组件来实现的。来自Oracle 概念指南关于日期的部分
Oracle uses its own internal format to store dates. Date data is stored in fixed-length fields of seven bytes each, corresponding to century, year, month, day, hour, minute, and second.
Oracle 使用自己的内部格式来存储日期。日期数据存储在每个七字节的固定长度字段中,对应于世纪、年、月、日、小时、分钟和秒。
You can use the DUMP()function to see the internal representation of any particular date (or any other value for that matter), but that's probably more than you need (or want) to know.
您可以使用DUMP()函数来查看任何特定日期(或任何其他与此相关的值)的内部表示,但这可能比您需要(或想要)知道的要多。
回答by Chris Noe
No. DATE is a timestampvalue with seconds precision. You need TIMESTAMP(3) to store milliseconds.
不。 DATE 是具有秒精度的时间戳值。您需要 TIMESTAMP(3) 来存储毫秒。
回答by Mostlyharmless
Apparently, not in form of millisecs.
显然,不是以毫秒的形式。
Which actually makes sense, since they do not have any running operations on current date/time:
这实际上是有道理的,因为它们在当前日期/时间没有任何正在运行的操作:
http://www.ixora.com.au/notes/date_representation.htm
http://www.ixora.com.au/notes/date_representation.htm
http://infolab.stanford.edu/~ullman/fcdb/oracle/or-time.html
http://infolab.stanford.edu/~ullman/fcdb/oracle/or-time.html