Hi all,
We are migrating the platform to the Outsystems cloud, hence we'll have a time zone issue to solve, since the server will always be in UTC + 0 and the users of the apps are all in Portugal and working within the Portuguese time zone (even if they go abroad and report an expense, the saved time will always be the Portuguese server time and that is a behavior we want to maintain). As my fellow Portuguese know, our country, from March to October uses UTC + 1 and from October to March uses UTC + 0.I'm going to run by you my idea and I'd like to know if there could be another/better way to do the migration of all the apps (there is a considerable amount of modules to search through).The idea is:1º create a site property in a core module that a systems admin will update when needed with the value 0 or 1, exactly when we have our daylight savings time updates.2º create a new public function in the same module, which executes this command: "addHours(CurrDateTime(), siteproperty)". 3º finally, we will look through every module and do a find "CurrDateTime()" and replace by "NewFunction()"And I think this will solve our problem. Am I wrong in my thinking process? Is there a better way?
regards
Hi,
In OS cloud server time is always in UTC time zone. Now it doesn't matter what is time zone of user. When you need to show date time on client side , OS will automatically show in user's time zone. Same while saving data it will save always in UTC. In short OS will do UTC <-> User time zone conversion automatically.
It will work for data type datetime, for only date or only time you need to do this manually.
Does it work like this on Reactive AND Web Traditional, or just on Reactive?
I think for both.
Here I will suggest one thing create one page application with one entity which store date time, date and time only. Play with this application in different way and you will get complete understanding. Check what date time you choose from application and what it stores in database and vice versa. Will take hardly 10 mins to try.
Unfortunately we don't have the apps deployed in the new cloud servers yet. I will test it when we have them there. ;)
No worries. I have created one demo for you.
These are values which I selected. I am in UTC+5:30
In database you can see it automatically saved in UTC for dateTime. For Date and Time only it didn't do any conversion.
regards.
I've finally managed to access the new servers and did the test you suggested.I tested 2 apps:- 1 reactive web, with the same result as you have. It saves in UTC 0 but shows in whatever UTC I have in my computer;
- 1 traditional web, where it saves in UTC 0, but also shows in UTC 0 regardless of my pc configuration;
This means we'll have to adjust the traditional apps.