Clarify using time_zone and date math in range query (#40655)

Currently, the docs correctly state that using `now` in range queries will not
be affected by the `time_zone` parameter. However, using date math roundings
like e.g. `now\d` will be affected by the `time_zone`. Adding this example
because it seems to be a frequently asked question and source of confusion.

Relates to #40581
This commit is contained in:
Christoph Büscher 2019-03-29 23:38:37 +01:00
parent 803ff3bc4c
commit 4f5a83dba2
1 changed files with 4 additions and 1 deletions

View File

@ -138,7 +138,10 @@ GET _search
-------------------------------------------------- --------------------------------------------------
// CONSOLE // CONSOLE
<1> This date will be converted to `2014-12-31T23:00:00 UTC`. <1> This date will be converted to `2014-12-31T23:00:00 UTC`.
<2> `now` is not affected by the `time_zone` parameter (dates must be stored as UTC). <2> `now` is not affected by the `time_zone` parameter, its always the current system time (in UTC).
However, when using <<date-math,date math rounding>> (e.g. down to the nearest day using `now/d`),
the provided `time_zone` will be considered.
[[querying-range-fields]] [[querying-range-fields]]
==== Querying range fields ==== Querying range fields