# Kibana Time filter time filter

**URL:** https://discuss.elastic.co/t/kibana-time-filter-time-filter/142230
**Category:** Kibana
**Created:** [July 30, 2018, 5:48pm UTC](https://discuss.elastic.co/t/kibana-time-filter-time-filter/142230 "2018-07-30T17:48:08Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![logesh\_j](https://avatars.discourse-cdn.com/v4/letter/l/ecccb3/32.png) [@logesh\_j](https://discuss.elastic.co/u/logesh_j)
#### Post date: [July 30, 2018, 5:48pm UTC](https://discuss.elastic.co/t/kibana-time-filter-time-filter/142230/1 "2018-07-30T17:48:09Z")

</div>

In Kibana 6.3 the absolute value is not getting correctly for the selections

```
{from: "now/d", to: "now/d", display: "Today", section: 0, $$hashKey: "object:223"},
{from: "now/w", to: "now/w", display: "This week", section: 0, $$hashKey: "object:224"}

```

For example if the Today is selected in Quick selection in the Kibana then the Absolute is showing as **"From:2018-07-30 00:00:00.000 To:2018-07-30 23:59:59.999"** But the timefilter.time.from and timefilter.time.to shows 2018-07-30 00:00:00.000. It is hapening for the quick ranges which has future date and times.

is there any issues with kibana 6.3 ?

---

<div class="post-metadata">

### Author: ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)
#### Post date: [July 30, 2018, 7:06pm UTC](https://discuss.elastic.co/t/kibana-time-filter-time-filter/142230/2 "2018-07-30T19:06:24Z")

</div>

Hey @logesh_j, are you using the `timefilter.time.from` and `timefilter.time.to` from within the context of a custom visualization or app that you're writing?

---

<div class="post-metadata">

### Author: ![logesh\_j](https://avatars.discourse-cdn.com/v4/letter/l/ecccb3/32.png) [@logesh\_j](https://discuss.elastic.co/u/logesh_j)
#### Post date: [July 30, 2018, 7:08pm UTC](https://discuss.elastic.co/t/kibana-time-filter-time-filter/142230/3 "2018-07-30T19:08:23Z")

</div>

Custom visualization. It works well with Today so far , Week to date etc. it is not working for the future to dates.

---

<div class="post-metadata">

### Author: ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)
#### Post date: [July 30, 2018, 7:10pm UTC](https://discuss.elastic.co/t/kibana-time-filter-time-filter/142230/4 "2018-07-30T19:10:25Z")

</div>

So your concern is that the "week to date" quick time-range is using the current time of the day, whereas "today" is for the entire day (including the rest of the day)?

---

<div class="post-metadata">

### Author: ![logesh\_j](https://avatars.discourse-cdn.com/v4/letter/l/ecccb3/32.png) [@logesh\_j](https://discuss.elastic.co/u/logesh_j)
#### Post date: [July 30, 2018, 7:13pm UTC](https://discuss.elastic.co/t/kibana-time-filter-time-filter/142230/5 "2018-07-30T19:13:00Z")

</div>

my concern is the quick select and absolute are not matching in the api timefilter.time.from,timefilter.time.to for Today,This week or quick select options which has future dates.

---

<div class="post-metadata">

### Author: ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)
#### Post date: [July 30, 2018, 7:20pm UTC](https://discuss.elastic.co/t/kibana-time-filter-time-filter/142230/6 "2018-07-30T19:20:40Z")

</div>

So if you select "Today" from the quick selection, and then look at the absolute tab, you'll see "2018-07-30 00:00:00.000" to "2018-07-30 23:59:59.999", and we're translating this into the following query (which matches those dates for my browser's timezone) which is sent to Elasticsearch:

```auto
         {
          "range": {
            "@timestamp": {
              "gte": 1532923200000,
              "lte": 1533009599999,
              "format": "epoch_millis"
            }
          }
        }

```

whereas if I select "Week to Date" from the quick selection, then I look at the absolute tab, I see "2018-07-29 00:00:00.000" to "2018-07-30 15:18:43.181", and we're translating this to the following Elasticsearch query:

```auto
        {
          "range": {
            "@timestamp": {
              "gte": 1532836800000,
              "lte": 1532978323349,
              "format": "epoch_millis"
            }
          }
        }

```

So "Today" is including everything for today, including future events. Whereas "Week to Date" is up until this time of the day.

Which API are you looking at that you aren't seeing this match?

---

<div class="post-metadata">

### Author: ![logesh\_j](https://avatars.discourse-cdn.com/v4/letter/l/ecccb3/32.png) [@logesh\_j](https://discuss.elastic.co/u/logesh_j)
#### Post date: [July 30, 2018, 7:25pm UTC](https://discuss.elastic.co/t/kibana-time-filter-time-filter/142230/7 "2018-07-30T19:25:52Z")

</div>

I would expect the same absolute value in the vis.API.timeFilter which is not happening.

---

<div class="post-metadata">

### Author: ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)
#### Post date: [July 30, 2018, 8:23pm UTC](https://discuss.elastic.co/t/kibana-time-filter-time-filter/142230/8 "2018-07-30T20:23:04Z")

</div>

@logesh_j, if I use `vis.API.timeFilter.getBounds()` in 6.3 within a visualization, I'm seeing the same behavior as what I've denoted above.

Can you share the exact code that you're having problems with?

---

<div class="post-metadata">

### Author: ![logesh\_j](https://avatars.discourse-cdn.com/v4/letter/l/ecccb3/32.png) [@logesh\_j](https://discuss.elastic.co/u/logesh_j)
#### Post date: [July 31, 2018, 2:58pm UTC](https://discuss.elastic.co/t/kibana-time-filter-time-filter/142230/9 "2018-07-31T14:58:21Z")

</div>

Interesting. Let me share the code..

---

<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: [August 28, 2018, 3:09pm UTC](https://discuss.elastic.co/t/kibana-time-filter-time-filter/142230/10 "2018-08-28T15:09:53Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
