The issue is that the DateTime value is not actually being converted. In Mendix, DateTime values are stored in UTC and microflows run on the server, so the value you see in the debugger is always the same raw DateTime.
Functions like formatDateTime and formatDateTimeUTC do not change the DateTime itself. They only create a formatted String. Even if you parse the value back to a DateTime, it is still interpreted as UTC. The reason it looks different in a grid is that the UI automatically displays DateTime values in the end user’s timezone.
In short, this is not a bug. DateTime conversion happens at display time in the UI, not in the microflow.
Hi,
This behavior is expected in Mendix.
DateTime attributes are always stored internally in UTC.Functions like formatDateTime() or formatDateTimeUTC() do not change the DateTime value itself — they only format it as a String for display.
So when you:
Assign the result to a DateTime variable, the value will remain the same
View it in a Data Grid, Mendix automatically converts UTC to the user’s local timezone, which is why it looks different there
What you should do
If you want a formatted value, store it in a String variable using formatDateTime()
If you want to display local time, let the UI handle it (Data Grid / Text widget)
Do not try to “convert and save” timezones in a DateTime variable — Mendix always saves DateTime in UTC
Summary
DateTime = stored in UTC (always)
formatDateTime() = display only (String)
UI handles timezone conversion automatically
This is standard Mendix behavior and works as designed.