title: How to serialize Xml Date only from DateTime in C#
body: <p>I've the following simple class;</p>
  
  <pre><code>Birthdays
  {
    public DateTime DateOfBirth {get;set;}
    public string Name {get;set;}
  }
  </code></pre>
  
  <p>I then serialise my object to Xml using;</p>
  
  <pre><code>try
  {
     XmlSerializer serializer = new XmlSerializer(obj.GetType());
  
     using (MemoryStream ms = new MemoryStream())
     {
          XmlDocument xmlDoc = new XmlDocument();
  
          serializer.Serialize(ms, obj);
          ms.Position = 0;
          xmlDoc.Load(ms);
          return xmlDoc;
      }
  }
  catch (Exception e)
  {
      ....
  }
  </code></pre>
  
  <p>The problem I have is that when the Xml is returned the DateOfBirth format is like 2012-11-14T00:00:00 and not 2012-11-14.</p>
  
  <p>How can I override it so that I'm only returning the date part ?</p>