Time Zone conversion into CST
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2022 02:37 AM
there are two fields A, B.
if user the user selects the future date/time on the form this will be populated in field A based on the user location, so we need to populate the CST time zone in field B
example
if user selects 4 pm and his location is eastern TZ then the field B should set 3 pm in central time

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2022 02:56 AM
Hey,
Date time is always stored in the same backend values, its the display value that can be manipulated.
If you are looking out for getting the display value in user's timezone, use getDisplayValue()
getDisplayValue() will always print the value as per user's timezone or the timezone present in the user settings.
eg:
var gdt = new GlideDateTime();
var userTimeZone = gdt.getDisplayValue();//gives you exactly that
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2022 03:13 AM
Hi,
refer my blog on how to convert timezone; enhance it for your requirement
If it helps please mark it helpful and also bookmark it
regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader