Using the inbound REST API, is it possible to specify date values in GMT time?

kevingoerlitz
Kilo Explorer

Using the inbound REST API, is it possible to specify date values in GMT time (preferably using ISO 8601 format)?   Or do I have to use the javascript:gs.dateGenerate() function which apparently requires the date/time to be specified in the timezone specified in the user's profile?

2 REPLIES 2

pankaj_puniani
ServiceNow Employee
ServiceNow Employee

For inbound REST Table API, if query parameter 'sysparm_input_display_value' is set to false (I think it's default), date value will be inserted into database as it's specified in request body. Date values are stored in GMT, so yes if you specify date values in GMT, it will be inserted as GMT if above mentioned parameter is false. However if parameter 'sysparm_input_display_value' is true, API will assume that date value is in user time zone and convert it into GMT before storing it.


Chris Swetnam
Tera Contributor

Thank you @pankaj_puniani !

Adding api/now/table/table_name?sysparm_input_display_value=true to the end of your POST will use the sys_user's time zone.