Is there any way to query the REST API using UTC dates?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2019 07:40 PM
I have the following query string trying to get all updated work orders since the last time I pulled.
sysparm_query=sys_updated_on>=javascript:gs.dateGenerate('2019-08-06','19:53:06')
The API provides the sys_updated_on as UTC. But the only way I can get that record is if I convert the UTC time that I want to local time:
sysparm_query=sys_updated_on>=javascript:gs.dateGenerate('2019-08-06','15:53:06')
How can I make it so I can use UTC time in my query and not have to convert it to local time?
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2019 11:23 PM
Hi Terry,
Please check the below link
here information regarding how to achieve UTC is given.
Mark my ANSWER as CORRECT and HELPFUL if it helped.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2023 01:56 AM
Rest is using the timezone at the endpoint to convert it. If you can try setting your REST user/service account to the UTC or GMT as it's timezone. Submitted query's will then always be considered as UTC irrespective of the endpoints timezone.