How can i get consistent datetime behaviour locally and on the server?
0
Hi, I'm encountering an issue while importing Excel data using the Data Importer. Each row represents a day, and one column contains the date of the row. When I run the import locally in Studio Pro, the system interprets the date based on my local timezone. However, when attempting to import the same spreadsheet on the published version in the free tier, the app treats the date as UTC. Currently, I utilize the date for grouping by month and summing values based on the date. Locally, the application functions as intended, but on the cloud, I'm experiencing discrepancies due to this issue. I've attempted toggling "Localize" off and on for the DateTime attribute, but it hasn't resolved the problem. My current thought is to manually adjust the timezone, but I'm curious if there might be a more effective solution. Running locally Running on the cloud Additionally, I'm using Studio Pro version 10.12.5. Could someone please suggest the best approach to handle this date inconsistency?
So do note that all dates in the Mendix database are stored in UTC and depending on the boolean will be converted back to the timezone of the user.
Problem with Excel is that it also contains timezone information but you might not see this. So all depends a bit on the data you are handling. If it is just a date you need and do not need the time part you could use the trim to date function to make sure that the Mendix time part is set to zero's. And do make sure that localize is set to no in that case.