- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2020 12:14 PM
I thought this would be simple but I'm not getting the expected results. In a Flow, I have a step to set the Planned Start Date for all Change Tasks belonging to a given Change. That step is successful. But then I'm working on adding/substracting hours to that Planned Start Date, and it never updates the field. My script is:
Solved! Go to Solution.
- Labels:
-
flow designer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2020 12:24 PM
You can use GlideDateTime() for adding the time and you cannot add hours directly, you just have to convert the hours into seconds by multiplying with 60*60
In the below example it will add 12 hours.
var gdt = new GlideDateTime(current.start_date);
var hours = 60*60*12;
gdt.addSeconds(hours);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2020 12:24 PM
You can use GlideDateTime() for adding the time and you cannot add hours directly, you just have to convert the hours into seconds by multiplying with 60*60
In the below example it will add 12 hours.
var gdt = new GlideDateTime(current.start_date);
var hours = 60*60*12;
gdt.addSeconds(hours);