title: How to get yesterday's date in C#
body: <p>I want to retrieve yesterday's date in my ASP.NET web application using C#.
  I've tried searching for a solution but have not had much success. The code I'm using just outputs today's date:</p>
  <pre><code>string yr = DateTime.Today.Year.ToString();
  string mn = DateTime.Today.Month.ToString();
  string dt = DateTime.Today.Day.ToString();
  date = string.Format(&quot;{0}-{1}-{2}&quot;, yr, mn, dt);
  </code></pre>
  <p>How can I get yesterday's date?</p>