Skip to content

Commit ffc8822

Browse files
author
Christoph Büscher
committed
[Docs] Explain incomplete dates in range queries (#30689)
The current documentation isn't very clear about how incomplete dates are treated when specifying custom formats in a `range` query. This change adds a note explaining how missing month or year coordinates translate to dates that have the missings slots filled with unix time start date (1970-01-01) Closes #30634
1 parent df3d210 commit ffc8822

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/reference/query-dsl/range-query.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ GET _search
109109
--------------------------------------------------
110110
// CONSOLE
111111

112+
Note that if the date misses some of the year, month and day coordinates, the
113+
missing parts are filled with the start of
114+
https://en.wikipedia.org/wiki/Unix_time[unix time], which is January 1st, 1970.
115+
This means, that when e.g. specifying `dd` as the format, a value like `"gte" : 10`
116+
will translate to `1970-01-10T00:00:00.000Z`.
117+
112118
===== Time zone in range queries
113119

114120
Dates can be converted from another timezone to UTC either by specifying the

0 commit comments

Comments
 (0)