title: Converting datetime to date. Why so difficult in C#
body: <p>Why converting a date like 17/09/2013 00:00:00 to a simple 2013/09/17 keeping it a DateTime object is so hard in C#???</p>
  
  <p>I can't believe it...</p>
  
  <p>Given a string like 17/09/2013 00:00:00, that's what i tried to get it and KEEPING IT DateTime:</p>
  
  <pre><code>DateTime x = DateTime.Parse(String.Format(element.data, "yyyy-MM-dd")).Date;
  </code></pre>
  
  <p>nothing, it keeps adding those 00:00:00</p>
  
  <pre><code>DateTime x = DateTime.Parse(String.Format(element.data, "dd/MM/yyyy").Replace("/", "-")).Date;
  </code></pre>
  
  <p>Nothing.</p>
  
  <p>I tried other dozen of tricks and things and I didn't succeed...</p>
  
  <p>All the examples on MSDN and their forums make use of string manipulation, which I DON'T WANT, because I need to pass dates to a webservice through a datetime.</p>
  
  <p>How can I transform a Datetime in this format dd/MM/yyyy hh:mm:ss  to just yyyy-MM-dd keeping it a DateTime?</p>
  
  <p>Thanks everyone</p>