# Calculate the difference between two times

**URL:** <https://discourse.nodered.org/t/calculate-the-difference-between-two-times/14911>\
**Category:** General\
**Created:** [29 August 2019 14:26 UTC](https://discourse.nodered.org/t/calculate-the-difference-between-two-times/14911 "2019-08-29T14:26:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hathemi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hathemi/32/3792_2.png) [@hathemi](https://discourse.nodered.org/u/hathemi)\
**Post date:** [29 August 2019 14:26 UTC](https://discourse.nodered.org/t/calculate-the-difference-between-two-times/14911/1 "2019-08-29T14:26:03Z")

</div>

is there a node that can determine the difference between a given time from and current time ? Or, should i need only a function node ?

---

<div class="post-metadata">

**Author:** ![JayDickson](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jaydickson/32/90592_2.png) [@JayDickson](https://discourse.nodered.org/u/JayDickson)\
**Post date:** [29 August 2019 14:47 UTC](https://discourse.nodered.org/t/calculate-the-difference-between-two-times/14911/2 "2019-08-29T14:47:09Z")

</div>

If you can get both timestamps into unix time format, you can just subtract the more recent time from the older time to get the difference in miliseconds.
