Ingested date field is displaying date 1 day earlier than date that is stored

0
I have an issue that when I ingest a date field into mendix it is stored in the database as 2014-05-21 00:00:00.000 but when I display it it shows up as 5/20/2014. The dates are stored with the Localize attribute set to yes but I have tried changing it to no and it get the same result. The customer wants the date they submit to the system to be the same as the date displayed. Is there a preferred solution to this question? 
asked
1 answers
16

Database fields are always stored in UTC. The 'localize'-option has only influence on the UI of your application.

  • If you change the attribute to Localize = No, it will show the same in the database as in the UI (both UTC).
  • If you change the attribute to Localize = Yes, it will show UTC in the database and it will translate the attribute to the timezone of your location.

 

In general, always use Localize = No, when the time is not relevant. If the time is relevant in your application and your application is used solely in one timezone, you will not have much troubles. If you have an application where the time is relevant and is used in multiple timezones, you should follow a masterclass in how to deal with datetime attributes in Mendix, because it's a pickle ;-),

 

 

 

answered