117
Views
8
Comments
Solved
Date Time conversion (Globalization and Localization)
Question

Hi All,

I have a business requirement , where I have to do some validation based on user's local date time .I need a way to convert server saved time to users local date time and implement some validation.

Is there any way to do that in outsystems?

Thanks

mvp_badge
MVP
Rank: #19
Solution

Pranav Pandey,

Adding to what assif_tiger wrote, after you get the browser's local date/time via JS you will need to send it to the server (assign it as the value to a hidden input and submit it with the remainder of your data, for instance).

Then you can use the TimeZone component Marco Arede suggested to do the conversions. An interesting article on this topic (that includes guidelines on how to implement it) can be found here.

mvp_badge
MVP
Rank: #148

Hi Pranav Pandey,

Maybe you want to check this forge component:

https://www.outsystems.com/Forge/component/500/time-zone/

Cheers!

Rank: #397

Hi Marco Arede,

I question here .How do we get the users local datetime and timezone (not the server time) automatically ?

Rank: #27215

Hi, you  can try to use the CurrDateTime(). In the client-side it will retun the device date and time.

You can see here.

mvp_badge
MVP
Rank: #19
Solution

Pranav Pandey,

Adding to what assif_tiger wrote, after you get the browser's local date/time via JS you will need to send it to the server (assign it as the value to a hidden input and submit it with the remainder of your data, for instance).

Then you can use the TimeZone component Marco Arede suggested to do the conversions. An interesting article on this topic (that includes guidelines on how to implement it) can be found here.