Time Zone conversion into CST

S_Deekshitha
Tera Contributor

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

2 REPLIES 2

Aman Kumar S
Kilo Patron

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

Best Regards
Aman Kumar

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

refer my blog on how to convert timezone; enhance it for your requirement

Convert timezone

If it helps please mark it helpful and also bookmark it

regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader