# Histogram facet - how is the start of the interval determined?

**URL:** <https://discuss.elastic.co/t/histogram-facet-how-is-the-start-of-the-interval-determined/3663>\
**Category:** Elasticsearch\
**Created:** [December 14, 2010, 6:37pm UTC](https://discuss.elastic.co/t/histogram-facet-how-is-the-start-of-the-interval-determined/3663 "2010-12-14T18:37:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ppearcy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppearcy/32/980_2.png) [@ppearcy](https://discuss.elastic.co/u/ppearcy)\
**Post date:** [December 14, 2010, 6:37pm UTC](https://discuss.elastic.co/t/histogram-facet-how-is-the-start-of-the-interval-determined/3663/1 "2010-12-14T18:37:06Z")

</div>

Hello,  
I am playing around with the histogram facet and was curious about  
an aspect of this functionality. I am converting the returned values  
back into UTC date strings and when I look at the results, I see  
something like (taken from our custom interface that wraps around ES,  
but hopefully should be clear):  
Facet.Result[0].Row[0].count:LONGLONG:1  
Facet.Result[0].Row[0].value:STRING:"2010-10-12 00:00:00"  
Facet.Result[0].Row[1].count:LONGLONG:1  
Facet.Result[0].Row[1].value:STRING:"2010-11-02 00:00:00"  
Facet.Result[0].Row[2].count:LONGLONG:1  
Facet.Result[0].Row[2].value:STRING:"2010-11-11 00:00:00"  
Facet.Result[0].Row[3].count:LONGLONG:1  
Facet.Result[0].Row[3].value:STRING:"2010-11-15 00:00:00"  
Facet.Result[0].Row[4].count:LONGLONG:1  
Facet.Result[0].Row[5].value:STRING:"2010-11-25 00:00:00"

What dictates the starting time slice for the facet interval? It  
appears to be based on UTC date offset, but if I wanted to start the  
interval based on EST date cutoff, is that possible? Or would I need  
to do a hourly interval, in this case, and create my own day buckets  
based on my start interval?

Thanks,  
Paul

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [December 15, 2010, 3:59am UTC](https://discuss.elastic.co/t/histogram-facet-how-is-the-start-of-the-interval-determined/3663/2 "2010-12-15T03:59:14Z")

</div>

All dates in ES are stored in UTC, so, yes, you would get it in UTC. You can do a script that calculates it yourself, but, it should be supported in ES with better date handling for histogram based facets.  
On Tuesday, December 14, 2010 at 8:37 PM, Paul wrote:

> Hello,  
> I am playing around with the histogram facet and was curious about  
> an aspect of this functionality. I am converting the returned values  
> back into UTC date strings and when I look at the results, I see  
> something like (taken from our custom interface that wraps around ES,  
> but hopefully should be clear):  
> Facet.Result[0].Row[0].count:LONGLONG:1  
> Facet.Result[0].Row[0].value:STRING:"2010-10-12 00:00:00"  
> Facet.Result[0].Row[1].count:LONGLONG:1  
> Facet.Result[0].Row[1].value:STRING:"2010-11-02 00:00:00"  
> Facet.Result[0].Row[2].count:LONGLONG:1  
> Facet.Result[0].Row[2].value:STRING:"2010-11-11 00:00:00"  
> Facet.Result[0].Row[3].count:LONGLONG:1  
> Facet.Result[0].Row[3].value:STRING:"2010-11-15 00:00:00"  
> Facet.Result[0].Row[4].count:LONGLONG:1  
> Facet.Result[0].Row[5].value:STRING:"2010-11-25 00:00:00"
> 
> What dictates the starting time slice for the facet interval? It  
> appears to be based on UTC date offset, but if I wanted to start the  
> interval based on EST date cutoff, is that possible? Or would I need  
> to do a hourly interval, in this case, and create my own day buckets  
> based on my start interval?
> 
> Thanks,  
> Paul

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 4:15am UTC](https://discuss.elastic.co/t/histogram-facet-how-is-the-start-of-the-interval-determined/3663/3 "2017-07-06T04:15:19Z")

</div>


