how to add duration field to today date and time
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2017 10:25 PM
i have duration field i am geeting 5days 2hr 50min 20 sec i want to add this duration to gs.nowdateandtime()./finall i want todaydate +5days 2hr 50min 20 sec,
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2017 01:57 AM
Yes, for this you can try getting the numeric value of delivery time and then add in now time. Try this:
var durationTotal = (current.variables.u_delivery_time.getGlideObject().getNumericValue())/1000;
var todayDateTime=new GlideDateTime();
var finalDuration = todayDateTime.addSeconds(durationTotal);
finalDuration is the result that you require.
Let me know if this works.