- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2016 05:17 PM
Hi,
I'm calling ServiceNow REST API to create change request record. But I'm not able to set the Start Date and End Date fields correctly when setting them as date string, e.g. "2016-09-05 20:00:00". The result on change record shows "2016-09-05 14:00:00" (don't know where such value is coming from). I notice these are glide_date_time field. How to set such field via REST API?
Thanks
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2016 05:34 PM
It's probably a timezone issue you're seeing. The value might be getting saved as "2016-09-05 20:00:00" in UTC, but then displaying it as "2016-09-05 14:00:00" in your timezone, or the system's timezone. Check what the value is being saved as in the database by using View XML from the form.
Take a look at http://wiki.servicenow.com/?title=GlideDateTime. You might need to use GlideDateTime with setDisplayValue to get the result you want.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2016 05:34 PM
It's probably a timezone issue you're seeing. The value might be getting saved as "2016-09-05 20:00:00" in UTC, but then displaying it as "2016-09-05 14:00:00" in your timezone, or the system's timezone. Check what the value is being saved as in the database by using View XML from the form.
Take a look at http://wiki.servicenow.com/?title=GlideDateTime. You might need to use GlideDateTime with setDisplayValue to get the result you want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2016 07:05 PM
It was timezone issue. Really appreciate your answer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2017 07:02 PM
HI Jack,
Can you please tell me how you handle the data issue?
I am having same issue not able to populate correct date in my date time field.
Thanks,
Santosh