
- 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 05:41 AM
Hi,
don't use getDisplayValue()
always add hours, days etc to GMT value and set the value in GMT only
System takes care of showing the value to user as per his/her timezone in profile
var gdt = new GlideDateTime(inc.u_copy_updated);
gdt.addDaysUTC(1);
gr.setValue('u_field', gdt.getValue());
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-12-2021 07:24 AM
Hope you are doing good.
Did my reply answer your question?
Would you mind marking the best matching answer as correct and helpful, to close this thread?
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
08-06-2021 02:29 AM
Hope you are doing good.
Did my reply answer your question?
Would you mind marking the best matching answer as correct and helpful, to close this thread?
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
09-26-2021 10:34 PM
Hope you are doing good.
Did my reply answer your question?
Would you mind marking the best matching answer as correct and helpful, to close this thread?
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
10-06-2021 05:44 AM
Hope you are doing good.
Did my reply answer your question?
Would you mind marking the best matching answer as correct and helpful, to close this thread?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader