How can we improve the Windows dev platform?

DatePicker date bug when system timezone changes

There seems to be a bug in the DatePicker control that appears when the system TimeZone changes.

This can be easily reproduced, start by creating a UWP app that has the DatePicker control, and a TextBlock below it, bind them both to a DateTimeOffset object that will contain the value of DateTime.Now.

Reproduction steps:
1) Start the app, controls show DateTime.Now
2) Use TZUTIL in CMD to change Timezone to something that makes the date change (For instance, from UTC-12 to UTC+14)
3) Update controls with DateTime.Now

Expected: DatePicker shows DateTime.Now.
Actual: DatePicker shows old day, when opened shows correct day.

The only workaround I've found so far is to reinitialize the page, by calling the Application.LoadComponent which can be copied from the pages InitializeComponent method (open with object explorer).

Here's a test app that can be used:
https://drive.google.com/drive/folders/1g75jIHKzsBqDzUy7MPZxgEnVcJlrQlpQ?usp=sharing

Just make sure to change timezone so that the day changes, and do it while the app is running, and observe the bug.

5 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    Shahin Dohan shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    2 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...
      • Shahin Dohan commented  ·   ·  Flag as inappropriate

        This seems to affect the Calendar controls as well, and actually even in Windows 10, the day changes in the taskbar, but when opening the calendar, it shows the wrong day!

      • Shahin Dohan commented  ·   ·  Flag as inappropriate

        It seems like there is also a bug when "Daylight Saving Time" changes in the same timezone (test by using TZUTIL and suffixing _dstoff), the day doesn't change at all, and here even reinitializing doesn't help but I need to restart the entire app!

      Feedback and Knowledge Base