UTC Time 


Hi All,

I need to develop a system that will be used across the UTC time zone.For example, my user in Singapore will be using UTC+8, user in Los Angeles,United America will be using UTC-8, and South Africa user will be using UTC+2.

I need to store the DateTime the transaction take place in UTC format in Database and then translate the UTC DateTime to local time according to the UTC Time offsets.I know that i need to create a user profile which maintain their UTC timezone so that system could know which zone they belong to.

My question is

1.How to store the DateTime in UTC format in OutSystems?

2.Does OutSystems have a list of UTC time offsets which is ready to use?I plan to use it in the user profile.

3.After user logging in to the System, how should i do to translate the UTC time to local time accorsing to the UTC time offsets?

Can anyone advise how to do this?

By the way, is this the correct way to handle system which will be used across UTC time zone?



Hi Johnson,

1. OutSystems assumes DateTime values are always on the Server's timezone. If you want to do time zone manipulations you probably want to consider the TimeZone forge component, and convert "current time zone" to/from UTC.

2. Again, I suggest the same forge component. You'd store a TimeZoneId reference attribute on the user profile.

3. Everytime you get a DateTime value from the database (will be UTC) you convert it to the user's timezone. Everytime you need to store a DateTime value on the database you will need to convert it from the user's timezone to UTC. 

A good approach to store DateTime values on the server is to always consider a standard timezone (UTF would be as good as any other, as long as everyone is aware which is the standard timezone) and convert to the user's one when you need to. Another one is to always store timezone information whenever you store DateTime values, this way it's always unambiguous. In either case if you'll need to make sure your DateTime values are in the same timezone if you are comparing them, as OutSystems itself doesn't store any timezone and as such assumes all DateTime values are in the same timezone.

BTW, mobile applications actually automatically translate between device-timezone to server-timezone.

Hope this helps!