- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2022 04:23 AM
Hi,
i have a Field with the Value "2022-09-09 08:04:37"
no i want to addy days and return it in a DateTime Field but i need only the Date (i cant change the Filed type)
So in want to Add Days and Set the Value like this: "2022-09-12 00:00:00"
So how i can make that 00:00:00 possible?
// Add your code here
var addDays = "";
var u_severity = "Red";
var u_created_date_utc = "2022-09-20 08:43:59";
if (u_severity== "Green") {
addDays = 84; //12 Weeks
} else if (u_severity== "Yellow") {
addDays = 42; //6 Weeks
} else if (u_severity== "Red") {
addDays = 5; //5 Dayss
}
var gd = new GlideDateTime();
gd.setDisplayValue(u_created_date_utc);
gd.addDaysUTC(addDays);
gs.log("requested_until: " + gd.getDisplayValue());
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2022 04:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2022 04:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2022 04:45 AM - edited 10-28-2022 04:45 AM
.