- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2017 03:52 PM
Can anyone help me with the script to get the time in the user's timezone?
var gt = new GlideDateTime();
var gdt = gr.getTime();
gs.print(gdt.getDisplayValue());
The script above is displaying with an error of (-1) hour.
Thanks in advance.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2017 04:07 PM
Use below if you just need time
var gt = new GlideDateTime();
gs.print(gt.getDisplayValue().split(' ')[1]);
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2022 11:30 PM
Thanks It works.
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2017 04:09 PM
var gt = new GlideDateTime();
var time = gt.getDisplayValue().split(" ")[1];
gs.print(time);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2017 04:55 PM
Mark it answered if it worked for you to remove it from unanswered list. Let me know, if you still find any issue.
Please mark this response as correct or helpful if it assisted you with your question.