Custom Widget: MxObj.get returns same value for localized and non-localized datetimes

1
Hi Community,  I am currently working on a widget which heavily depends on displaying correct timestamps.  Therefore I want to get non-localized dateTime attributes from the database and do the magic stuff in the custom widget.  For testing I have created a second localized time attribute. I enter the same dateTime for both attributes, let’s say “2019/03/06 16:00”.  Now in the database I got two different values, like expected (because my local time is UTC+1): Time(non-localized): 2019-03-06 16:00:00.0 Time(localized):  2019-03-06 15:00:00.0   Buf after retrieving both attributes via the client api in the custom widget, I get the same value for both attributes : “1551884400000” which translates to 2019-03-06 15:00:00.0 but I would assume that I would get 1551888000 (“2019-03-06 16:00:00.0”) for the non-localized time.. Why is this happening? Am I missing something?  Thanks in advance, Alex   Addition:  I would expect that I get one of the following two results: Same value for both:  2019/03/06 16:00 , as the localized attibute gets localized to UTC +1 and the non-localized value as it is Two different values: The values stored in the database as UTC, 2019/03/06 16:00 from the non-localized and 2019/03/06 15:00 from the localized attribute   But I get 2019/03/06 15:00 for both.
asked
1 answers
1

Have a look at the documentation: https://docs.mendix.com/refguide/date-and-time-handling#6-to-localize-or-not-to-localize

Mendix stores its dates in UTC, so that's why the value is the same.

answered