title: How to compare dates independent of current culture in .NET
body: <p>I hardcode a trial expiration date in my .net 2.5 app. how do I compare it with the user's system date such that the comparison is accurate regardless of the user's culture settings?</p>
  
  <p>DateTime maxTrialDate = DateTime.Parse("11/17/2020", new System.Globalization.CultureInfo("en-US"));</p>
  
  <p>DateTime curDate = DateTime.Parse(DateTime.Now.ToShortDateString(), new System.Globalization.CultureInfo("en-US"));</p>
  
  <p>//the next line of code uses the DateDiff method to compare the two dates -dont recall its //exact syntax.</p>
  
  <p>On my XP machine the above works if the control panel regional setting for datetime is en-US, but if I change it to en-AU, then the above code that sets curDate fires a FormatException "Date is not in a correct string format"</p>