Date Intelligence - Deployed App

0
Hi Everyone,   I've kind of seen this question posed before but none of the answers I've seen really meet my scenario. I have an app that recreates a record in another system when it's created or updated after a scheduled API query. The date / time format from the API query is ISO standard, so e.g. : 2025-06-14 and I ended up having to create a function that transformed this into a standard date format (EN-AU) such as 14/06/2025. I have an XPath constraint on a DataGrid that looks similar to date <= '[%BeginOfCurrentDay%]'.    When I run the app in my local environment (everything set to AU timezone) - it all works just as expected, however, when I deploy this app to a licenced node and look at the data grid, none of the matching data appears. I set the project timezone to AU and redeployed, but that didn't help.    I suspec thtere is a timezone issue on the deployed app / server, but I have a text label in my app to display the UTC time and even when it goes over to the same date in UTC format, my data still isn't correctly filtered.    Does anyone have any ideas where else I can look? I suspect the data will appear correctly "tomorrow" and I could edit the filter to say something like '[%BeginOfCurrentDay%] - 1' but I feel this is a bodge - a bandaid at best, so I'd prefer to fix the actual problem.   Any new pointers would be gratefully received!   Thanks!
asked
1 answers
0

Mendix Date Filter Issue – Solution

  • The XPath token [%BeginOfCurrentDay%] is resolved in UTC, not local time.

  • Your app works locally (AU timezone) because local runtime matches your timezone.

  • On the licensed node, server runs in UTC, causing date filter mismatches.

  • User timezone must be set to “Client” or specific AU timezone in Security → User Roles.

  • Mendix stores all DateTime attributes in UTC; display format has no impact on logic.

  • Avoid using date as string (e.g., “14/06/2025”) in logic—only format for UI display.

  • XPath filters like [date <= '[%BeginOfCurrentDay%]'] fail in non-local timezones due to offset.

  • Instead of relying on XPath tokens, create start and end of day values in a microflow adjusted for AU time.

  • Use expressions like:

    parseDateTimeUTC(formatDateTime([%CurrentDateTime%], 'yyyy-MM-dd') + ' 00:00:00', 'yyyy-MM-dd HH:mm:ss')

    then adjust with addHours() for timezone offset (e.g., +10 for AU).

  • Pass those values ($StartOfDayAU, $EndOfDayAU) into a DataGrid via microflow or datasource and use them in constraints.

  • Avoid relying on default tokens like [%BeginOfCurrentDay%] in timezone-sensitive apps.

  • Problem is not in display formatting but in server-side evaluation of date filters using UTC.

answered