title: How to Compare DateTime Values
body: <p>I am saving my app's first launch date plus three days from now as a string value. I am then attempting to perform a string comparison when the MainPage is NavigatedTo to compare these string values. To note, this will have to work in any culture set, although from what I understand here <a href="http://msdn.microsoft.com/en-us/library/system.datetime.now(v=vs.110).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.datetime.now(v=vs.110).aspx</a> <code>DateTime.Now</code> will always get the local values for a correct comparison. Currently I am getting a <code>TargetInvocationException</code> when doing this, and not sure how to solve the issue</p>
  
  <p>Store this when the app is first launched into a custom <code>Settings</code> class which will save the string value</p>
  
  <pre><code>Settings.FutureDate.Value = DateTime.Now.AddDays(3).ToString();
  </code></pre>
  
  <p>Check this in the app page when loaded</p>
  
  <pre><code>DateTime currentDate = DateTime.Now;
  DateTime futureDate = DateTime.Parse(Settings.FutueDate.Value); 
  
  //If three days has passed, notify user
  if (currentDate &gt;= DateTime.Parse(Settings.FutureDate.Value)) //TargetInvocationException error occurs here
  {
      MessageBox.Show("Three days has passed.");
  }
  </code></pre>
  
  <p>EDIT</p>
  
  <p>When checking the <code>currentDate</code> and <code>Settings.FutureDate.Value</code> values from above before the comparison, I see the following.</p>
  
  <pre><code>currentDate = {8/13/2014 3:07:17 PM}
  futureDate = {8/16/2014 3:07:09 PM}
  </code></pre>