CurrentDateTime in different time zones

9
How does my Mendix application deal with [%CurrentDateTime%] on DateTime attributes since the users are logged in from countries in different time zones?
asked
2 answers
9

The token [%CurrentDateTime%] gives the current date and time of the timezone the server is in. It does no matter in which timezone the user lives in. Tokens are always used in queries and they are executed on the database. In the database, they will be automatically converted to UTC. This is correct, because dates are in the database stored in UTC. But dates which are visible in the Mendix client or which are saved by a client user, are converted to or from the timezone of the user.

For example: If user A who lives in timezone UTC-0500 stores the datetime July 3, 2009, 23:00:00, User B who lives in timezone UTC+0100 sees this datetime as follows: July 4, 2009, 05:00:00, because it’s converted to his timezone.

answered
1

The date that will be stored is the current date and time from the user that is logged in and that triggers the action.
The database stores this time and date in UTC.
For example:
A user triggers an action on 4-8-2009 at 11:00 AM GMT+1 he works in Rotterdam.
In the database the date will be stored in UTC, which is 4-8-2009 at 9:00 AM UTC
If a user in England retrieves this date from the database the date will be converted to his timezone. Which means that the user will see this date as: 4-8-2009 at 10:00 AM GMT It was 10 o'clock in England when the first user triggered the action.

So each user will see that date and time exactly as it was at the moment the action was triggered.

answered