- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2023 07:32 PM
HI,
I have a UI page , which has GRID table, This grid table has below,I want to show the BookStartDateTime and BookEndDateTime value as per user timezone and dateformat and timeformat
Username
BookStartDateTime
BookEndDateTime
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2023 09:14 PM
If my response helped please mark it correct and close the thread so that it benefits future readers.
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-21-2023 07:44 PM
Hi @Ketan Pandey ,
If you use getDisplayValue() method on the BookStartDateTime and BookEndDateTime fields, ServiceNow will automatically convert it to the User Date Time format as per his preferences.
Please let me know if you have any difficulties using this, share the code block where you are getting these values to help you with the exact code.
Please mark my answer helpful and accept as solution if it helped you 👍✅
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2023 07:52 PM
Thank You Anvesh, This helped.
One issue i am facing, Time is not showing 24 hour format
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2023 08:43 PM
Hi @Ketan Pandey ,
I'm glad this helped, 24 Hr issue @Ankur Bawiskar sir already answered.
Please mark my answer helpful and accept as solution if it helped you 👍✔️ (You can mark any number of answers as solution)
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2023 08:11 PM
to show value as per logged in user you should use getDisplayValue() wherever date/time is shown
by default it's 24 hour format. Did you check somebody updated the system property to show in 12 hour format?
glide.sys.time_format -> this will impact entire instance
Properly setting an instance to 12-hour format
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader