Date Time wrong Day on Execute OQL Statement

0
Hi I have try to use mendix for the first time to develop my project with date time attributes I have this two entity with both column named Start_Date both set localized to Yes First entity used dataset with OQL query Second entity uses on Execute OQL Statement on my Microflow with the same OQL query(Execpt for the where ) with the Dataset but getting different result on sa OQL Statement on the microflow with a day difference SAMPLE RESULT First entity(DATA SET): 10/25/2021 Second Entity(MICROFLOW):  UTC time: 2021-10-24 16:00:00.000 Session time: 2021-10-24 16:00:00.000 +0000    
asked
2 answers
0

When you are handling date time, Mendix will save the date in UTC format.

When rendering on browser, it will convert it to the the date time appropriate for the timezone the browser is set. 

I think that is the reason, you are seeing this difference. 

Or, one another reason could be, the user’s timezone in the application is set to different one than the one in browser.

For example, if you user’s time zone is set to European time, while that in browser in Indian time, then you will see 1 day difference, which is also something I faced.

Read the documents:

https://docs.mendix.com/refguide/date-and-time-handling#6-to-localize-or-not-to-localize

https://docs.mendix.com/refguide/datetime-handling-faq

answered
0

When you save the date, it is always saved in UTC format only. 

When you set it as localized, which you already did, it will show the date in the user timezone format that is as per the browser settings.

When it is non-localized, then the date will not be converted. 

So you cannot influence the way datetime is stored, unless, if you want to store the date time as String, which I would not advise. 

Check the timezone set for the user and also the browser.

answered