I want to find the difference between the two date time fields and need to update in other duration field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2018 02:45 AM
I want to find the difference between the two date time fields and need to update in other duration field.
Log in Time and Logoff time are Date/ Time fields and Total Log time is duration field.
I have written server side script for this to work calling a glide ajax call. But it is not calculating the difference.
Client script:
Script include is:
Please help me to resolve it.
Thanks in Advance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2018 06:11 AM
Hi,
Can you please mark one of our response correct and useful and close the thread.
Please let us know if you have additional questions.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2018 01:58 AM
Ok..
I am trying to find the difference between the two duration values using the same method.
can u help?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2018 02:11 AM
You'll need to use subtract to get the difference between 2 duration fields, dateDiff is for date/time fields:
var duration1 = current.duration1_field //or wherever your duration1 field is
var duration2 = current.duration2_field //or wherever your duration2 field is
var duration = duration1.subtract(duration2);
var finalDuration = duration.getDurationValue();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2018 06:27 AM
It did not worked for me...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2018 02:30 AM
Didn't above method work for you?