Convert Duration into minute
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2017 03:50 AM
I have a field on incident table of duration type which contains days hours and minute . Is it possible to convert into minute and auto populate into another field.
Thanks,
Sourabh
- Labels:
-
Personal Developer Instance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2017 03:56 AM
Hey Sourabh,
You can do it like that -
var minutes = current.duration / 1000 /60;
current.fieldToStoreMinutes = minutes ;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2017 12:49 PM
Hi Nayan,
I have a Duration type field. Which contains value in days,hour , minutes and seconds.
I want to capture this value into another field of type string in minutes.
I am looking for client script for this.
I tried above solution but didn't get success.
Thanks,
Sourabh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2017 10:16 PM
Hello Sourabh,
Split the Duration field values and store into array then convert it into minutes.
var day = current.duration_field.split(' ');
var dayintomin = day[0] * 24*60;
var hrs = day[1].split(':');
var hrsintomin = hrs[0] * 60;
var mins = hrs[1] + hrs[2]/60;
var totalmins = dayintomin + hrsintomin + mins;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2017 02:26 AM
Hello Sourabh,
Mark ANSWER as correct if my answer fulfill your requirement.
How To Mark Answers Correct From Community Inbox