# Time diff moment add parameter

**URL:** <https://forums.losant.com/t/time-diff-moment-add-parameter/4969>\
**Category:** Feature Request\
**Tags:** time\
**Created:** [March 10, 2023, 6:02pm UTC](https://forums.losant.com/t/time-diff-moment-add-parameter/4969 "2023-03-10T18:02:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paolo\_Proxy](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@Paolo\_Proxy](https://forums.losant.com/u/Paolo_Proxy)\
**Post date:** [March 10, 2023, 6:02pm UTC](https://forums.losant.com/t/time-diff-moment-add-parameter/4969/1 "2023-03-10T18:02:38Z")

</div>

Hi there,  
What about adding also the unit in the Diff operator?

 ![Screenshot from 2023-03-10 17-58-45](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/c/cecc264b202d01a82e9f5f3064213a8cd680a382.png)  
The default is msec, but would be nice to have an optional parameter to change the units.  
Cheers.

---

<div class="post-metadata">

**Author:** ![Sebastian\_Turner](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/sebastian_turner/32/4024_2.png) [@Sebastian\_Turner](https://forums.losant.com/u/Sebastian_Turner)\
**Post date:** [March 10, 2023, 7:38pm UTC](https://forums.losant.com/t/time-diff-moment-add-parameter/4969/2 "2023-03-10T19:38:41Z")

</div>

Hi @Paolo_Proxy !

Indeed, the Date/Time Node [`diff` operator](https://docs.losant.com/workflows/logic/date-time/#diff) produces an output in milliseconds, with no other built-in options to reformat. I will open a feature request to have this feature evaluated.

You can use a [Math Node](https://docs.losant.com/workflows/logic/math/) to convert the output from milliseconds to the desired unit (such as dividing by 1000 to convert to seconds).

Depending on your workflow, it might be easier to skip the Date/Time Node altogether and use the [`{{formatDateRelative date relativeTo}}`](https://docs.losant.com/workflows/accessing-payload-data/#formatdaterelative-date-relativeto) helper to calculate the difference between two time values.

Thanks for the feedback!

---

<div class="post-metadata">

**Author:** ![Paolo\_Proxy](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@Paolo\_Proxy](https://forums.losant.com/u/Paolo_Proxy)\
**Post date:** [March 23, 2023, 6:13pm UTC](https://forums.losant.com/t/time-diff-moment-add-parameter/4969/3 "2023-03-23T18:13:58Z")

</div>

Ah yes interesting:

Outputs a relative date value (such as “5 minutes ago”). Date is calculated relative to the `relativeTo` parameter, which defaults to the current time when not set. When used in a dashboard, this will use the current browser locale when formatting.

But what is the actual object type, is it a time interval?

---

<div class="post-metadata">

**Author:** ![Sebastian\_Turner](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/sebastian_turner/32/4024_2.png) [@Sebastian\_Turner](https://forums.losant.com/u/Sebastian_Turner)\
**Post date:** [March 27, 2023, 8:28pm UTC](https://forums.losant.com/t/time-diff-moment-add-parameter/4969/4 "2023-03-27T20:28:16Z")

</div>

@Paolo_Proxy

The output of the `formatDateRelative` helper is a string (as you noted, something like `"5 minutes ago"`).

Which object are you referring to?
