# Canvas -Display Time diff

**URL:** https://discuss.elastic.co/t/canvas-display-time-diff/198935
**Category:** Kibana
**Tags:** canvas
**Created:** [September 10, 2019, 4:36pm UTC](https://discuss.elastic.co/t/canvas-display-time-diff/198935 "2019-09-10T16:36:26Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![cesarlino](https://avatars.discourse-cdn.com/v4/letter/c/a5b964/32.png) [@cesarlino](https://discuss.elastic.co/u/cesarlino)
#### Post date: [September 10, 2019, 4:36pm UTC](https://discuss.elastic.co/t/canvas-display-time-diff/198935/1 "2019-09-10T16:36:26Z")

</div>

Hi,

I read [Difference between two DATETIMEs in ESSQL in Canvas (No script fields)](https://discuss.elastic.co/t/difference-between-two-datetimes-in-essql-in-canvas-no-script-fields/175471) that TIMESTAMPDIFF is not yet available for elasticsearch sql. I am wondering if there is another way to present time difference in my Canvas with datasource based on Elasticsearch query.

I have the same row with startTime and endTime. I would like to present overall time (endTime - startTime). Is it possible to make it:

1. directly in elasticsearch sql without using TIMESTAMPDIFF
2. using some function inside the Expression Editor in Canvas

Any ideas?

Regards,  
Cesar Lino

---

<div class="post-metadata">

### Author: ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)
#### Post date: [September 11, 2019, 4:13am UTC](https://discuss.elastic.co/t/canvas-display-time-diff/198935/2 "2019-09-11T04:13:36Z")

</div>

@Catherine_Liu is there a way out to achieve this? `TIMESTAMPADD` and `TIMESTAMPDIFF` it's on our TODO list: [https://github.com/elastic/elasticsearch/issues/37927](https://github.com/elastic/elasticsearch/issues/37927)

Thanks  
Rashmi

---

<div class="post-metadata">

### Author: ![cesarlino](https://avatars.discourse-cdn.com/v4/letter/c/a5b964/32.png) [@cesarlino](https://discuss.elastic.co/u/cesarlino)
#### Post date: [September 11, 2019, 8:06am UTC](https://discuss.elastic.co/t/canvas-display-time-diff/198935/3 "2019-09-11T08:06:47Z")

</div>

Hi @rashmi, thank you for your reply. I saw these functions are still pending but it is not clear when they will come... Any date planned? My idea about this post was to find out other way to deal with this requirement before having these functions available. I would appreciate if @Catherine_Liu or anybody else could point out an alternative way...

Regards,  
Cesar Lino

---

<div class="post-metadata">

### Author: ![cesarlino](https://avatars.discourse-cdn.com/v4/letter/c/a5b964/32.png) [@cesarlino](https://discuss.elastic.co/u/cesarlino)
#### Post date: [September 12, 2019, 3:13pm UTC](https://discuss.elastic.co/t/canvas-display-time-diff/198935/4 "2019-09-12T15:13:20Z")

</div>

Hi,

I was able to do that converting to millis and calculating them using math on mapColumn and converting back to Date:

mapColumn name="overallTime" fn={math "subtract(ingestEndMillis,ingestStartMillis)"}

Thanks,  
Cesar Lino

---

<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: [October 10, 2019, 3:13pm UTC](https://discuss.elastic.co/t/canvas-display-time-diff/198935/5 "2019-10-10T15:13:23Z")

</div>

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