title: String was not recognized as a valid DateTime on one PC
body: <p><strong>Language:</strong> C#, <strong>.Net framework:</strong> 4.5, <strong>method used:</strong> DateTime.ParseExact</p>
  
  <p>So in one of our projects we're using the following function to parse a string into a DateTime:</p>
  
  <pre><code>private DateTime FormatDate(string date, string format)
  {
      try
      {
          IFormatProvider culture = new CultureInfo("en-US", true);
          DateTime dt = DateTime.ParseExact(date, format, culture);
          return dt;
      }
      catch (Exception ex)
      {
          throw new Exception(ex.Message);
      }
  }
  </code></pre>
  
  <p>and calling it like this:</p>
  
  <pre><code>DateTime startDate = FormatDate("01/17/2016", "M/d/yyyy");
  </code></pre>
  
  <p>On our 3 PCs, this code works perfectly when Date format on each PC is dd/MM/yyyy, but on 2 of the PCs, when their date format is dd-MMM-yy it produces a bug when trying to execute ParseExact:</p>
  
  <blockquote>
    <p>String was not recognized as a valid DateTime.</p>
  </blockquote>
  
  <p>While it keeps working on the third PC even when using the dd-MMM-yy format.
  I compared Date and Time settings on all 3 PCs, settings are all equal, the one difference is that on the 2 PCs we use Visual Studio 2013 while on the third Visual Studio 2015.</p>
  
  <p><strong>Exception details:</strong></p>
  
  <p>Message: String was not recognized as a valid DateTime.</p>
  
  <p>InnerException: No Inner Exception</p>
  
  <p>Stack:       at System.DateTime.ParseExact(String s, String format, IFormatProvider provider)
     at AssetTracking.PopUpWindows.AddItem_Warranty.MakeReminder(TrackersDataContext atdc, Items ni, string itemId) in d:\Solutions\Trackers\Trackers\PopUpWindows\AddItem_Warranty.xaml.cs:line 807
     at Trackers.PopUpWindows.AddItem_Warranty.&lt;>c__DisplayClass8.b__3() in d:\Solutions\Tackers\Trackers\PopUpWindows\AddItem_Warranty.xaml.cs:line 685</p>
  
  <p><strong>The question:</strong>
  I'm not sure, is the different IDE part of the problem? or what else can produce this bug on some PCs and not on others having the exact same date and time settings?</p>