How to get the timezone of the servicenow instance using REST API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2019 09:52 PM
I need to get timezone and date format of the ServiceNow instance using REST API's, so going through the documentation I formulated a REST query as below :
This query returns the timezone and date format but it returns empty value if the timezone is the System default.
How can I get the system default timezone?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2019 11:30 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2019 11:40 PM
can you add more details on this requirement , why do you need api for this ?
anyway as naveen mentioned about the properties so just want to add here if you did not define default time zone on your instance then gs.getProperty('glide.sys.default.tz') will give you empty value. so you need to use below code to get the user time zone.
var gdt = new GlideDateTime();
gs.print(gdt.getUserTimeZone());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2019 01:03 AM
Please help!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-30-2019 01:31 AM
no it wont be for all the users. refer the script which i have added that will give you the user timezone