
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2021 04:52 AM
if the date is below
2021-07-03 09:30:00
|
then getDisplayValue is giving 2021-07-03 13:00:00
Please help
Regards,
Debasis
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2021 05:14 AM
getDisplayValue() will always print the value as per user's timezone or the timezone present in the user settings.
Can you explain where you are using that and what is not working?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2021 04:55 AM
Hi there,
Can you share how you are using it? Also where?
Please provide some more info.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020, 2021 ServiceNow Community MVP
2020, 2021 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2021 04:58 AM
Hi Mark,
I am using it in a schedeule script and for doing some functionalities i am just fething the date/tome field present in incident field.
Below is the code
var copy= inc.u_copy_updated.getDisplayValue();
gs.log("Copy Value"+copy)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2021 05:14 AM
Hi,
if you wish to copy date/time value from 1 field to another then do this to set the value internally in GMT always
var copy = inc.u_copy_updated;
gr.setValue('u_field', copy);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2021 05:19 AM
Hi Ankur,
I want get the date/time field value and want to add 24 hours to the time and then want to set the time to next field
but when i am using this getDisplayValue it is only giving me wrong value
Please help.!!!
Regards,
Debasis