title: Elasticsearch Date Histogram with time zone and extended bounds
body: <p>In Elasticsearch 2.x I do a date histogram aggregation and I need to set both the <code>time_zone</code> and the <code>extended_bounds</code> options:</p>
  
  <pre><code>...
  "date_histogram": {
    "interval": "1d",
    "field": "time",
    "min_doc_count": 0,
    "format": "epoch_millis",
    "time_zone": "Europe/Rome",
    "extended_bounds": {
      "min": "1496268000000",
      "max": "1498859999999"
    }
  }
  ...
  </code></pre>
  
  <p>It returns the error <code>failed to parse date field [1496268000000] with format [epoch_millis]</code>, but it doesn't make sense to me because <em>that value is actually in milliseconds</em>:</p>
  
  <pre><code>{
    "error": {
      "root_cause": [
        {
          "type": "parse_exception",
          "reason": "failed to parse date field [1496268000000] with format [epoch_millis]"
        }
      ],
      "type": "search_phase_execution_exception",
      "reason": "all shards failed",
      "phase": "query",
      "grouped": true,
      "failed_shards": [
        {
          "shard": 0,
          "index": "[...]",
          "node": "[...]",
          "reason": {
            "type": "parse_exception",
            "reason": "failed to parse date field [1496268000000] with format [epoch_millis]",
            "caused_by": {
              "type": "illegal_argument_exception",
              "reason": "Parse failure at index [0] of [1496268000000]"
            }
          }
        }
      ]
    },
    "status": 400
  }
  </code></pre>
  
  <p>I am actually using Grafana and trying to find a workaround for <a href="https://github.com/grafana/grafana/issues/6222" rel="nofollow noreferrer">this problem</a>.</p>