Timezone behaviour in mendix

0
Hi,In the user account, I have selected the timezone as London (Europe) and logged in using that user. However, the DateTime attribute is still displaying the date and time based on the system/server timezone instead of the user’s selected timezone. I also tested this in the local environment, and it still does not reflect the user account timezone. Why is the date and time not being displayed according to the user’s timezone setting?Could anyone please help me understand why this is happening?
asked
1 answers
0

Usually this happens because of one of these reasons:

  • the DateTime attribute is configured with Localize = No
  • the displayed value is coming from a String instead of a true DateTime
  • the timezone is being converted manually somewhere in logic
  • browser/client timezone is being used instead of the Mendix user timezone


First thing I would check is the entity attribute itself.


For the DateTime attribute:

  • open the attribute properties
  • make sure Localize = Yes


This is important because:

  • when Localize = Yes, Mendix stores the value in UTC and converts it based on the logged-in user timezone
  • when Localize = No, Mendix treats it more like a fixed server/system datetime


Also note:

  • changing the timezone in the user account usually requires a fresh login/session refresh
  • in local environment, browser timezone can sometimes create confusion during testing


One more thing:

If you are formatting the datetime manually using:

  • Java action
  • JavaScript
  • formatDate without localization
  • custom REST parsing


then Mendix automatic timezone conversion may not apply.


So I would verify:

  1. Localize = Yes
  2. user timezone saved correctly
  3. re-login after changing timezone
  4. using actual DateTime attribute directly in UI
  5. no manual datetime conversion happening in logic

In most cases, the issue is the Localize property being disabled.

answered