ES 官网说,
- 超过纪元( 1970 )以前的日期无法使用整型表示,要用日期格式的字符串
- 可又说,内部日期都会转为整型,表示 milliseconds-since-the-epoch ==》 那这种情况,若 1970 之前的日期呢?难道是区别对待吗?分两种情况存储吗?( 1 ) 1970 后的日期,不管啥格式都内部转整型存储 ( 2 ) 1970 前的时间,就用字符串存储
若有大佬知晓,还请不吝解释。
以下为官网原话:
- Values for milliseconds-since-the-epoch must be non-negative. Use a formatted date to represent dates before 1970.
- Internally, dates are converted to UTC (if the time-zone is specified) and stored as a long number representing milliseconds-since-the-epoch.
- Queries on dates are internally converted to range queries on this long representation, and the result of aggregations and stored fields is converted back to a string depending on the date format that is associated with the field.
- Dates will always be rendered as strings, even if they were initially supplied as a long in the JSON document.
