title: Dynamic time zone offset in elasticsearch aggregation?
body: <p>I'm aggregating documents that each have a timestamp. The timestamp is UTC, but the documents each also have a local time zone (<code>"timezone": "America/Los_Angeles"</code>) that can be different across documents.</p>
  
  <p>I'm trying to do a <code>date_histogram aggregation</code> based on local time, not UTC or a fixed time zone (e.g., using the option <code>"time_zone": "America/Los_Angeles"</code>). </p>
  
  <p><strong>How can I convert the timezone for each document to its local time before the aggregation?</strong></p>
  
  <p>Here's the simple aggregation:</p>
  
  <pre><code>{
    "aggs": {
      "date": {
        "date_histogram": {
          "field": "created_timestamp",
          "interval": "day"
        }
      }
    }
  }
  </code></pre>