
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2015 04:37 AM
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();
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2015 06:48 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2015 04:45 AM
Hi Brian,
Try this.
var gdt = new GlideDateTime();
var date = gdt.getDate().getDisplayValue();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2015 04:50 AM
I will try it but I'm not sure how that would make a difference. If manual execute the scheduled job during normal working hours it works fine. It only when I run it late at night like 9:30 PM. Could there be some sort of working hours setup somewhere that is causing that to change?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2015 04:57 AM
Thanks for the update.
getDisplayValue(); //Gets the datetime in the current user's display format and time zone.
http://wiki.servicenow.com/index.php?title=GlideDateTime#gsc.tab=0
Please let me know the outcome.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2015 04:30 AM
Hello Pradeep,
This worked but now it displays the time. Is there anyway to strip the time?