Why do date pickers set time on localized attributes?
0
Mendix Version 10.22.0 In the below screenshots I compare the values of a non-localized and localized attribute EndDate. The values are derived from a user selection in a simple, native date picker widget. The Date format is 'Date' (so no time component for the user to set). Note this is a US app so the date is July 9 2025 (format differs) Non-localized User calendar picker selected date of 5/9. UTC: 5/9/2025 00:00:00 Session/local time: 5/8/2025 20:00:00 -0400 This is what I would expect; it's not localized so the date is set to what the user selected and the time is 00:00:00. Localized User calendar picker selected date of 5/9. UTC: 5/10/2025 00:00:00 Session/local time: 5/9/2025 20:00:00 -0400 This seems unusual to me. Why set the time to 20:00:00 a time relative to my timezone that will ensure the stored date is always a day off? Why not 00:00:00? Or 12:00:00? In this scenario, sure the session/local date is preserved and will display as expected, BUT the stored date in the db will always be a day off. The conversion back to UTC will always be the next day if the time is set to 20:00:00. Sure this doesn't matter if the date picker or simple UI elements use this. But now consuming systems like APIs or other apps and/or reporting will be one day off. So why set the time to 20:00:00 when a user selects a date from a date picker with a localized attribute? Why not 00:00:00? Or 12:00:00 since there are plus and minus time zones. If it's 12:00:00 then everyone except developers in New Zealand (sorry +1300) will be immune.