title: Parsing or Formating Min/Max date value - For elaticsearch aggregation
body: <p>I have end up here with a odd scenario. I have this aggregation to perform using Elasticsearch and c#:</p>
  
  <pre><code> "aggs": {
      "Max_opened_at": {
        "max": {
          "field": "opened_at"
        }
      },
      "Min_opened_at": {
        "min": {
          "field": "opened_at"
        }
      }
    }
  </code></pre>
  
  <p>So far, so good as it is returning the aggregated keys to me as following:</p>
  
  <pre><code>    Response: {
    "took" : 29,
    "timed_out" : false,
    "_shards" : {
      "total" : 1,
      "successful" : 1,
      "failed" : 0
    },
    "hits" : {
      "total" : 30218,
      "max_score" : 0.0,
      "hits" : [ ]
    },
    "aggregations" : {
      "Min_sys_created_on" : {
        "value" : 1.402508357E12,
        "value_as_string" : "1402508357000"
      },
      "Min_sys_updated_on" : {
        "value" : 1.453305924E12,
        "value_as_string" : "1453305924000"
      }
  </code></pre>
  
  <p>The problem here is the return itself. When I tried to convert the value ("1453305924000") assuming it was a Unix format using the standard conversion below, it fails due "out of range value" exception:</p>
  
  <pre><code>DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
  return Convert.ToInt64((date - epoch).TotalSeconds);
  </code></pre>
  
  <p>I believe I've got 2 alternatives:</p>
  
  <p>A) Find a way to convert this value ("1453305924000") to a understandable date format. The Unix conversion didn't worked as I said...</p>
  
  <p>B) Using C#, add the "format" property in the Elastic query. It would look like this:</p>
  
  <pre><code>  "aggs": {
      "test": {
        "min": {
          "field": "sys_created_on", 
          "format" : "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
        }
      }
  </code></pre>
  
  <p>Unfortunately I have no idea how to do add this "format" property using NEST C#.</p>
  
  <p>Any thoughts for A or B?</p>
  
  <p>Thanks a lot!!  </p>