GlideDateTime.getDisplayValue() WITH TIMEZONE?

G24
Kilo Sage

Gurus,

Hello.  I see getDisplayValue() documented here .  But I see that it does not include the user's timezone.

How would one make a version of this that automatically includes the users timezone ABBREVIATION???

 

Examples of what I'm looking for:

03/10/2023 07:00 PM EST

03/10/2023 07:00 AM PDT

12/02/2023 09:00 AM PST

 

 

//I would like to be able to execute the magical function something like this;
var myGDT = new GlideDateTime();
gs.addInfoMessage(myGDT.getDisplayValueWithUserTz());

 

1 REPLY 1

Samaksh Wani
Giga Sage
Giga Sage

Hello @G24 

 

Kindly Try this :-

 

  1. Navigate to All > System Properties > System.
  2. Locate the property System timezone for all users unless overridden in the user's record [glide.sys.default.tz].
     

     

    By default, the field is blank. If you have not defined a time zone for this property, America/Los Angeles is the default.

  3. Add a time zone in the format Country/City or using the name of a time zone (for example, GMT) and click Save. For available values, see Time zone representation.

    The new system time zone automatically cascades to all users who do not already have a specified time zone. If a user selects a different time zone, or if the administrator selects a different time zone for them, the selected time zone is assigned to the user. The system time zone is not used.

     

    Plz mark my solution as accept if you find it helpful.

     

    Regards

    Samaksh