How do I convert a time field to local time?

KS18
Giga Guru

How do I convert a time field to local time?

4 REPLIES 4

Aman Kumar S
Kilo Patron

Hi @KS

Follow below links to get local time:

How to get current date and time of our instance

How do I get the local date/time when using GlideDateTime().getTime().getByFormat('hh:mm:ss a');

 

Feel free to mark correct, if your issue has been resolved, so it ends up in solved queue.

Will be helpful for others looking for the similar query.

Best Regards
Aman Kumar

I would like to do the opposite of what is described in the following article.

https://community.servicenow.com/community?id=community_question&sys_id=dc920df4db396b002e8c2183ca961909

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

What's your exact requirement?

Where you want to convert that?

If in server side then when you use getDisplayValue() then it gives date/time in local timezone of the user.

Regards
Ankur

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

I would like to do the opposite of what is described in the following article.

https://community.servicenow.com/community?id=community_question&sys_id=dc920df4db396b002e8c2183ca961909