GlideDateTime

Brian Lancaster
Tera Sage

I have a task where I put the date in the subject line.   This request gets created every night a 9:30 pm EDT but for some reason the date that gets put into is not the date the request and tasks were created but the next days date.   Why is it note pulling the correct date?   Our system default time zone is US/Eastern

var gdt = new GlideDateTime();

var date = gdt.getDate();

1 ACCEPTED SOLUTION

I found a different work around.   Instead of using .getDate() in my code I changed it to getLocalDate().   This gets the date based on the submitters timezone.   I used my servicenow local admin account as the submitter and made sure the timezone was Eastern.


View solution in original post

12 REPLIES 12

The following is the result in my instance. The last one is the response to the solution i believe you're looking for:



Time.jpg


I found a different work around.   Instead of using .getDate() in my code I changed it to getLocalDate().   This gets the date based on the submitters timezone.   I used my servicenow local admin account as the submitter and made sure the timezone was Eastern.


Cool!