How to get the system Timezone and it's name?

How to get the system Timezone and it's name?

  

Hello community,

I want to get the timezone and it's name from the system. 

If my server time is UTC but if I'm accessing the application in India, it should me timezone as UTC+5:30 and Timezone name as 'India Standard Time'.

How to get it?

Please advice.

Thanks and Regards,

Suraj Borade

Hi Suraj,

You need to use this component https://www.outsystems.com/forge/Component_Details.aspx?ProjectId=500. You can get system timezone and also convert to your timezone if you want.

Regards,

Marcelo

Hi Marcelo,

I tried that component but it is giving wrong information.


I'm in India timezone, so it should have returned me Indian timezone name and not Coordinated Universal Time.

Thanks and Regards,

Suraj Borade


Hi Suraj,

The component gave you the server timezone. If you want the client timezone you only can get it with JS. Look to this https://stackoverflow.com/questions/1091372/getting-the-clients-timezone-in-javascript.

Regards,

Marcelo

Hi Marcelo,

This looks great. Let me give it a try.

Thanks and Regards,

Suraj Borade

Hi Suraj,

Related to your question a teammate wrote this article. Hope it helps you.

Regards,

Marcelo

Marcelo


Thanks for the reference. Very good article!!


Regards