How to add 14 days from the day when it was created
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2023 10:42 PM
How to add 14 days to one of the date field from when it was created in scoped app.
var gd = new GlideDateTime();
gd.addDaysLocalTime(14);
gd.setDateNumericValue(gd.getNumericValue());
Its adding 14 days but when the record created after 8 PM time . its adding 15 days.
can someone please help me in adding exactly 14 days from the date when it is created
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2023 11:03 PM
addDaysUTC() is also behaving same like this. its one of the custom field its type is date.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2023 11:28 PM
try like this
var gd = new GlideDateTime();
var d = gd.getDate();
d.addDaysLocalTime(14);
from date time fetch only date then add 14 days
Bharath Chintala