var startTime = new GlideDateTime(current.variables.reactivation_end_date); var dateToPrint = startTime.getDate(); var startTime1 = new GlideDateTime(dateToPrint.getByFormat('YYYY-dd-MM')); var endTime = new GlideDateTime(); var dur = GlideDateTime.subtract( startTime1, endTime); gs.info("dur.getDayPart()"+dur.getDayPart()); gs.info("dur.getDayPart()startTime"+startTime); gs.info("dur.getDayPart()endTime"+endTime);
How to change the date format in ServiceNow ?