How can I display date field with considering timezone?

Tomoaki Tagawa1
Tera Contributor

Hi all,

I would like to display date field for every global user.

 

For example, if Japanese users see a data field A as 2019-02-11 in the Japanese morning,

At the same time I would like US users to see a date field A as 2019-02-10 in the US evening.

I know date/Time field is automatically calculate time in the database and display according to their local timezone. ( For example, update and created field.)

 

Best regards,

Tomoaki

1 ACCEPTED SOLUTION

Mrigank Gupta
Giga Expert

var datetime = new GlideDateTime();

datetime.getDisplayValue() ---> This will give you what you need. The same date but in the current user's timezone.

You can use this link for more info.

https://www.linkedin.com/pulse/working-dates-servicenow-mrigank-gupta/

View solution in original post

8 REPLIES 8

Thanks,

Can I apply yours to a date type field (Not for date/time) ?

Respect man 🙂

hi I got the same requirement, i need to display time according to logged in user timezone.

where I should apply this logic in Client script or in business rule.

Mrigank Gupta
Giga Expert

Yes. You can