25
Views
5
Comments
UTC Timezone
Application Type
Reactive

Hi Team,

In my application, I am displaying data from an external RDS database in OutSystems. The issue is that the same record shows different timestamps for users in India and the US. This occurs because OutSystems Reactive automatically converts DateTime values to the user’s local timezone.

I need a solution to either:

  1. Display the timestamp exactly as it is stored in the RDS database (UTC format), without any automatic timezone conversion, or

  2. Convert the CST timestamp back to UTC so that all users see a unified time.

It would be preferable to achieve this without using any Forge components.

2016-04-22 00-29-45
Nuno Reis
 
MVP

Hello.

That is a known feature. https://success.outsystems.com/support/enterprise_customers/maintenance_and_operations/outsystems_cloud_and_time_zones/

From my experience, all users want time in their timezone.

The workarounds are the same everywhere.

The server can send as text (if it is not a datetime, can't be converted).

Or the client can apply the AddMinutes with a country variable to change the time.

2021-09-06 15-09-53
Dorine Boudry
 
MVP

This happens when an attribute of type DateTime comes from server to client in a reactive app.  So most obvious option is to retrieve separately the date part and the time part, and bring them back together on client side.  (i.e. place them after each other)  Or, if you don't want to do anything other than display it, bring it back to the client as a text.

2019-01-07 16-04-16
Siya
 
MVP

@Siddharth Vyas :  What I have observed is that the DateTime reaches the client in UTC, and it is then converted to local time based on the user’s timezone.

Eg : When browsed in IST timezone


When browsed in CET timezone

To convert a local DateTime back to UTC, you can use the  JavaScript function new Date().toISOString();

Note : DateIn and DateOut are 'Text' datatype.  

You can see the result in second column ("Created On (UTC)") in the first 2 screen shots. It's same irrespective of the timezone. .

2019-01-07 16-04-16
Siya
 
MVP

@Siddharth Vyas : Another simple ( but db heavy ) option is to transform it as Text by having a calculate attribute with the formula = DateTimeToText(Book.CreatedOn)


2024-10-05 13-30-20
Huy Hoang The

Correct, if you want to keep the UTC value, you convert it to text before displaying it on the screen. It's similar to creating a file have datetime fields in the server action.

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