13
Views
4
Comments
Solved
Timezone conversion is happening automatically in reactive web app
Application Type
Reactive

Hi, 

I am storing the CurrDateTime() on the entity. Its getting stored in UTC format but while displaying on the screen it is auto converted and displaying in local time zone. 

How can I display the CurrDateTime() in UTC format itself?

How to stop this auto conversion?

Solution

Hi,

In Reactive web, in client side the date time is converted to the time zone where the device is. If you need to get the date and time what stored in db without adding any JavaScript function, then you need to add a logic in server side to fetch date and time and converted in two attributes. 


Thanks,

Valar

logic.PNG

Rank: #68

Hi there,


The date times are rendered client side so they are displayed in the timezone of the client device, behind the scenes the time is the same.

If you want to display the time in UTC, my advice is to create a client function to use Javascript to do that, something like this:


Then on the screen where you use the date time, you just have to encapsulate that in a call of this function and you would get the date in UTC.


Hope it helps.


Cheers,
João

Rank: #1994

Thanks João . 

But I want to know Are there any built-in functions in Outsystems which we can use instead of Javascript?

Rank: #68

There is not, hence the Javascript which is a workaround.

In my opinion, most of the times it makes sense to see the date time on the timezone you are so it makes sense for me that the default behavior is the one it is right now.

Solution

Hi,

In Reactive web, in client side the date time is converted to the time zone where the device is. If you need to get the date and time what stored in db without adding any JavaScript function, then you need to add a logic in server side to fetch date and time and converted in two attributes. 


Thanks,

Valar

logic.PNG