How to add 14 days from the day when it was created

Santhosh23
Tera Expert

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

6 REPLIES 6

addDaysUTC() is also behaving same like this. its one of the custom field its type is date.

BharathChintala
Mega Sage

 

@Santhosh23 

try like this

var gd = new GlideDateTime();

var d = gd.getDate();

d.addDaysLocalTime(14);

 from date time fetch only date then add 14 days

 

If my inputs have helped with your question, please mark my answer as accepted solution, and give a thumb up.
Bharath Chintala