How to get actual date and time values in rest api
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 12:32 AM
I am trying to send updated cases everyday through scripted rest api but here the problem is I am getting date and time values in GMT timezone but I wanted the data in EST timezone.
Can someone help me whether it is possible or not to get date and time in actual display value(EST) instead of GMT?
Thanks in advance..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 01:18 AM
Hi @lucky6,
There's a system parameter you can add to your URI to retrieve the display value.
sysparm_display_value=true
If you want to retrieve both the sys_id and display value, add the following to your URI
sysparm_display_value=all
For more info: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0546240
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 02:30 AM
Hi @Robbie ,
Still i am not getting exact date and time in response..here i can see 5hrs difference time..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 04:24 AM
Hi @lucky6,
If I understand you correctly, you have written a Scripted Rest API which is being called. Within this script, you are passing various case data including some date/time fields.
Can you share the segment of your script where you are passing the date/time fields?
With no visibility as yet, you basically need to do something similar to the below:
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2024 01:09 AM - edited 02-05-2024 05:59 AM
Hi @lucky6,
Did you see my earlier response and solution?
If I understand you correctly, you have written a Scripted Rest API which is being called. Within this script, you are passing various case data including some date/time fields.
Can you share the segment of your script where you are passing the date/time fields?
With no visibility as yet, you basically need to do something similar to the below:
@lucky6 - To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.
Thanks, Robbie