Export to Excel - Date sometimes 1 day higher, sometimes 1 day lower

If i want to export a table (data grid) i have sometimes the problem that the date in the excel export is 1 day higer than in the data grid itself. Sometimes I even figured out for some tables that the date in the excel export is 1 day lower than in the data grid.
3 answers

Sounds like your date attribute(s) might be localized.  You can read about it here:. https://docs.mendix.com/refguide7/attributes#localize-only-for-the-date-and-time-attribute-type. If they are localized, a time that is 1 in the morning CET on June 1 would download as May 31.  


The reason for this as other have already pointer out is a mix up of time zones. Excel always uses timezone from java which is either
1) the java runtime timezone (prior to Mendix8)
2) Common Locale Data Repository  (Mx8+)

This is not related to the date time attributes and whether or not they are localized.

Depending on where your server is hosted e.g Europe vs US this can lead to different outcomes.This is a bug in the platform. To work around this you can add a helper string attribute that holds the date formatted as a string using formatDateTimeUTC.  However, the date will no longer be recognized by excel as a date which loses the ability to do sorting.




Thank you very much for your help guys!