Timezone issue

1
Hi All, I am creating activities in different time zones. I am creating series activities from activity screen. But when I input the dates from screen, the activity is creating for one extra day due to timezone difference. I added console logs in microflow. In development, it is creating correctly. But when I deploy in QA (on-premise), it is creating for one day extra. Please find the below logs.   it should create below activities.   But it is creating activities like below.     QA console log: Activity - 1: StartDate - EndDate : 13-04-2020 13:30 - 13-04-2020 13:45  ---- UTC : 13-04-2020 13:30 - 17-04-2020 05:00   Dev console log: Activity - 1: StartDate - EndDate : 13-04-2020 04:00 - 13-04-2020 04:15  ---- UTC : 13-04-2020 03:00 - 16-04-2020 18:30   End date in QA environment is one day more than the input end date. I couldn’t understand the timezones used by Dev and QA environments.  Can anyone please help me with this. Thank you.
asked
2 answers
0

Timezones can be a very tricky subject.

Did you check the “localized” option for datatime attributes? It must be set to no if you want to disregard timezone-differences.

Here's a good read about the subject, although it always gives me a headache. https://docs.mendix.com/refguide/datetime-handling-faq

answered
0

Note that timezones are never stored in the database. All the date times in the database are UTC. If you set the boolean localize to yes it will depending on the timezone of the user represent that UTC date time to timezone of the user.
Example localize is set to yes
It is now the 9th of april 0100 hours in the amsterdam time zone. Currently we are two hours ahead so the UTC date time will be 8th of april 2300 hours and that is what is stored in the database. Hence the date switch.

Example localize is set to no

It is now the 9th of april 0100 hours but on screen it will show the UTC date so it would show as the 8th of april 2300 hours and is the same value as stored in the database.

Again try really to comprehend the datetime handling FAQ. Good for the brains :)

Regards,

Ronald

 

answered