function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rafael Martins Dos SantosRafael Martins Dos Santos 

lightning component ui-DateTime - How corret the time zone

I added a field ui:inputDateTime in my lightning component but when I select the time, I have as value the different time zone.

User-added image
I Want convert this time to my time zone (Brasil).
Can someone help me to fix this?

Hi Rafel,

Please go through the below link.

Let me know if it helps .

Raj VakatiRaj Vakati
You need to use   $locale.timezone

The $Locale global value provider returns information about the current user’s preferred locale. You can try using $locale.timezone in Aura to get the time zone and perhaps use it along with new Date to get the Date similar to the current loggged in user's timezone.

Refer this link
Rafael Martins Dos SantosRafael Martins Dos Santos
Thanks for reply.

Raj Vakati, Do you have some example of how to use this !$Locale.timezone.
Because I want get the time value from a field and convert to my current time zone.
All the exemple that I found just tell how to get the current time, and not the value from a field.