title: C# date formatting results in previous day
body: <p>Here's the C# code:</p>
  
  <pre><code>employee.BirthDate.ToString("yyyy-MM-dd");
  </code></pre>
  
  <p>While running the unit test on my computer with BirthDate = "1/1/1981" that comes from the SQL Server database, the above code results in "1981-01-01". But, while running the same code on the QA server, it  results in "1980-12-31".</p>
  
  <p>I tried doing the following:</p>
  
  <pre><code>employee.BirthDate.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture);
  employee.Birthdate.ToString("yyyy-MM-dd", new CultureInfo("en-US"));
  </code></pre>
  
  <p>But both these lines of code result in the same "1980-12-31" on the QA server.</p>
  
  <p>What could be possibly causing this and what is a solution?</p>
  
  <p>NOTE: The clock on my computer and the QA server are in sync. Also, I checked the .NET globalization in IIS on QA server, where the code is running, and the culture is set to "Invariant".</p>