# How do I subtract two timestamps in VisualBuilder

**URL:** https://discuss.elastic.co/t/how-do-i-subtract-two-timestamps-in-visualbuilder/125277
**Category:** Kibana
**Created:** [March 22, 2018, 10:30pm UTC](https://discuss.elastic.co/t/how-do-i-subtract-two-timestamps-in-visualbuilder/125277 "2018-03-22T22:30:21Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![chrisronline](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrisronline/32/28230_2.png) [@chrisronline](https://discuss.elastic.co/u/chrisronline)
#### Post date: [March 23, 2018, 2:43pm UTC](https://discuss.elastic.co/t/how-do-i-subtract-two-timestamps-in-visualbuilder/125277/2 "2018-03-23T14:43:06Z")

</div>

Hi @iamthealex,

I'm thinking you can make a scripted field to convert the date to a number, then use that in the Visual Builder.

See this post for more information [[scripted field] convert String date to timestamp](https://discuss.elastic.co/t/scripted-field-convert-string-date-to-timestamp/94885)

---

_[View the full topic](https://discuss.elastic.co/t/how-do-i-subtract-two-timestamps-in-visualbuilder/125277)._
