17
Views
2
Comments
Solved
How to display server time in front-end
Application Type
Reactive

Hello everyone,

I am kind of new to Outsystems. And due to our project requests, I am trying to show in a table, the server time (UTC) for the users:

So I created a Server Action called "GetServerTime" using the DateTime forge extension:

And assigned the result of the "CurrDateTimeUTC" as the output:

Then on my front-end module I have a client action that calls this server action and assigns the output to a local variable (of type text):

And then in my save action, I assigned this variable to the respective field:

But I am only getting the Hour and not the full Date:

What am I doing wrong here?

Sorry but due to sensitive information I can not share my oml.

Thank you!

UserImage.jpg
VerdeD
Solution

Hello Rajat,

Thanks for your time. But I am not sure what happened, it seems to be working now. I updated the dependencies between the modules again and it is now saving correctly:

2020-07-21 19-28-50
Rajat Agrawal
Champion

Hi Diogo Gomes,

Have you checked what data type you used while storing data in ServerTime variable,

or action you have created it is returning datetime or only its returning time.


Regards,

Rajat

UserImage.jpg
VerdeD
Solution

Hello Rajat,

Thanks for your time. But I am not sure what happened, it seems to be working now. I updated the dependencies between the modules again and it is now saving correctly:

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