1288
Views
2
Comments
[Time Zone] How to get the Current Time of a  TimeZone?
Question
time-zone
Reactive icon
Forge asset by André Vieira

i have list of all the timezone  . So how do i get the current time of the user base on their respective timezone.

2022-07-24 08-50-37
Gokula Kannan P

Hi Vikas C,

    You cannot directly achieve this. If it is a mobile means to get Geo locations then you fetch their timezone, or else u give an option in profile to users manually set their timezone after only you get thier current timezone. Because the local system and server timezones are different. when you go to online you'll receive the server's timezone, not getting a local system or device's timezone.

2019-07-25 15-05-16
Henrique Silva

Vikas C wrote:

i have list of all the timezone  . So how do i get the current time of the user base on their respective timezone.

You can use 

ConvertToUTC(CurrDateTime(), GetCurrentTimeZone().TimeZone.Identifier)

As a function (or as a action) in a expression to get the current time in UTC

Now that you have the UTC Time, you can convert to anywhere else using either the AddHours() function with a + or - value, or use the ConvertFromUTC() Function, in a similar way as the example before. 

For this last one you will have to know de Identifier that the plugin uses for the desired time zone.


Hope this helps!!


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.