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-23-2018 03:06 AM
you can use the dateDiff() method to make the calculation:
var start = this.getParameter('sysparm_strt');
var end = this.getParameter('sysparm_end');
var duration = gs.dateDiff(start, end, false);
return duration;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2018 03:18 AM
Can u brief in some detail ..please
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2018 03:20 AM
How can i pass this duration to Total Log time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2018 03:57 AM
just run that code in your script include and it should return the duration in days hours:minutes:seconds
durCalc: function(){
var start = this.getParameter('sysparm_strt');
var end = this.getParameter('sysparm_end');
var duration = gs.dateDiff(start, end, false);
return duration;
}