Skip to content

Commit

Permalink
[Docs] Explain incomplete dates in range queries
Browse files Browse the repository at this point in the history
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 elastic#30634
  • Loading branch information
Christoph Büscher committed May 17, 2018
1 parent 399489b commit 77b3dca
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/reference/query-dsl/range-query.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ GET _search
--------------------------------------------------
// CONSOLE

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

===== Time zone in range queries

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

0 comments on commit 77b3dca

Please sign in to comment.