Browse Source

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
Christoph Büscher 6 years ago
parent
commit
c9d05adedd
1 changed files with 4 additions and 1 deletions
  1. 4 1
      docs/reference/query-dsl/range-query.asciidoc

+ 4 - 1
docs/reference/query-dsl/range-query.asciidoc

@@ -138,7 +138,10 @@ GET _search
 --------------------------------------------------
 // CONSOLE
 <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