Date Hist Aggregation - Recreating "post_zone" (post ES 2.x)

Hi,

the bucket keys in the aggregation are now always returned in UTC millis. If you want to display the value in the time zone that you use in the aggregation, this is returned in the key_as_string

  • the time_zone parameter shifts bucket boundaries to start/stop according to the specified time_zone
  • in the returned bucket: key_as_string returns a formated version of that key in the specified timezone, e.g. for "time_zone": "-02:00", a daily bucket would contain "key_as_string" : "2014-05-26T00:00:00.000-02:00", so this can be used to display local time instead of UTC. You can also specify different formats in the request, like e.g. with "format": "yyyy-MM-dd/HH:mm.ss" your would get "2014-05-26/00:00.00"

Hope this solves your problem.