And make sure to read this: https://docs.mendix.com/refguide/date-and-time-handling#1-introduction
and this: https://docs.mendix.com/refguide/datetime-handling-faq
Regards,
Ronald
It sounds like you’re mixing UTC DateTimes and local DateTimes. I think every developer will have hit this problem at some point in their career, and it is confusing the first time you see it.
If you’re seeing it add 7 hours like in your example, it could be the DateTime in Mendix is stored as UTC, but you are displaying it using a local timezone such as PDT or MST.
Have a read of the documentation on the Mendix site around DateTimes, especially the DateTime Handling FAQ.
Good luck!
Hi!
You can use the function FormatDateTime to format your DateTime value.
It's your choice to set the user's calendar and timezone or using UTC.
Perhaps this is the problem if your time is wrong, another timezone of the user?
More information about Parse & Format Date functions: https://docs.mendix.com/refguide/parse-and-format-date-function-calls
Use Mendix’ functions. It does a lot for you. In this case you should use FormatDateTime($YourDatevalue, "MM-dd-yyyy HH:mm:ss”)
FormatDateTime($YourDatevalue, "MM-dd-yyyy HH:mm:ss”)
Experiment with the FormatDateTime at https://mydemoversion8-sandbox.mxapps.io/ ->FunctionFiddler->FormatDateTime