# Calculate Difference between 2 Dates

**URL:** <https://discuss.elastic.co/t/calculate-difference-between-2-dates/246300>\
**Category:** Kibana\
**Created:** [August 25, 2020, 1:54pm UTC](https://discuss.elastic.co/t/calculate-difference-between-2-dates/246300 "2020-08-25T13:54:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hiba](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hiba/32/110919_2.png) [@hiba](https://discuss.elastic.co/u/hiba)\
**Post date:** [August 25, 2020, 1:54pm UTC](https://discuss.elastic.co/t/calculate-difference-between-2-dates/246300/1 "2020-08-25T13:54:53Z")

</div>

Hi All,  
it's possible to calculate the difference between two dates in a TSVB visualization!

i use Kibana 7.7.0

---

<div class="post-metadata">

**Author:** ![mattkime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkime/32/43522_2.png) [@mattkime](https://discuss.elastic.co/u/mattkime)\
**Post date:** [August 25, 2020, 6:03pm UTC](https://discuss.elastic.co/t/calculate-difference-between-2-dates/246300/2 "2020-08-25T18:03:21Z")

</div>

Unfortunately TSVB doesn't support scripted fields - [https://github.com/elastic/kibana/issues/13928](https://github.com/elastic/kibana/issues/13928)

You would need to update the documents with the calculated value.

---

<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:** [September 22, 2020, 6:03pm UTC](https://discuss.elastic.co/t/calculate-difference-between-2-dates/246300/3 "2020-09-22T18:03:30Z")

</div>

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