title: Desktop app's datetime format compatibility with Win10
body: <p>I have a WPF application and I'm using the MVVM framework.
  In my view model, I have a date time setter that checks if the value of the variable has changed and if yes, sets the new value to the variable.</p>
  
  <p>My problem is that the value of the date time if incorrect every time it enters the setter.</p>
  
  <p>For example: Datetime value is January 11, 2019</p>
  
  <p>On initial set value is equal to January 11, 2019, but on the succeeding run it became November 1, 2019 -- and on the next run back to January 11, 2019 and so on and forth.</p>
  
  <p>Thus causes an StackMemoryException due to infinite looping in the setter function.</p>
  
  <p>I've tried adding an if statement to check id the old and new value is the same but the problem is the value of the setter always switcher from Jan to Nov.</p>
  
  <p>I've tried parsing the date to a same date format.</p>
  
  <pre><code>public DateTime? ActionDate
  {
      get { return actionDate; }
      set
      {
         if (value.HasValue &amp;&amp; !actionDate.HasValue)
         {
              actionDate = value;
              OnPropertyChanged("ActionDate");
         }
         else if (value.HasValue &amp;&amp; actionDate.HasValue &amp;&amp; actionDate.Value.Date.ToString("MM/dd/yyyy") != value.Value.Date.ToString("MM/dd/yyyy"))
          {
              actionDate = value;
              OnPropertyChanged("ActionDate");
           }
        }
  }
  </code></pre>
  
  <p>I also tried running the app in a machine using Windows 7 OS and it works okay. Any suggestions will be helpful. </p>
  
  <p>Thanks</p>
  
  <p>Edit: I've already resolved this problem. The issue was the Datepicker tag in my xaml. I bind the model value to both the SelectedDate and Text attribute of the Date Picker that's why the setter was called twice and incorrect date is set. I just remove the Text binding from the Datepicker in xaml file.</p>
  
  <p>Thanks</p>