title: Convert DateTime to string "yyyy-mm-dd"
body: <p>Im wondering how to convert a DateTime to a string value (yyyy-mm-dd). I have a console application and i want the user to be able to write a Date as "yyyy-mm-dd" which are then converted as a string.</p>
  
  <p>I have tried this but it works in oposite direction it seem. The idea is that the user enters a Start date and an End date with Console.ReadLine. Then these values are stored as strings in string A and B wich could then be used later. Is that possible?</p>
  
  <pre><code>string A = string.Empty;
  string B = string.Empty;
  DateTime Start = DateTime.ParseExact(A, "yyyy-mm-dd",CultureInfo.InvariantCulture);
  Console.WriteLine("Enter StartDate! (yyyy-mm-dd)");
  Start = Console.ReadLine();      
  DateTime End = DateTime.ParseExact(A, "yyyy-mm-dd",CultureInfo.InvariantCulture);
  Console.WriteLine("Enter EndDate! (yyyy-mm-dd)");
  End = Console.ReadLine();
  </code></pre>
  
  <p>Thank you</p>