Time Duratio

I am trying to calculate time duration between two column which have date formats like (2024-06-24T09:31:59.000Z) but the formaula that I am using shows me error.
dateDiff({disconnecttimestamp},{initiationtimestamp},‘SS’) this is the formula that I am using

but it is showing the result in negative

Can someone please help

1 Like

Hello @Shrey_pandey, two things that may help to ensure this calculation runs as expected. First, you may want to switch the order you are putting the fields in the dateDiff calculation.

The first value should be the earliest timestamp. Based on your field names, I am guessing initiationtimestamp would come before disconnecttimestamp. Then, to ensure the format of the date fields is correct, you can use truncDate to set them to the seconds timestamp level. I’ll write an example below:

dateDiff(truncDate('SS', {initiationtimestamp}), truncDate('SS', {disconnecttimestamp}), 'SS')

That should provide the output you are looking for. I will mark this response as the solution, but please let me know if you have any remaining questions. Thank you!

1 Like