title: Force XmlSerializer to serialize DateTime as 'YYYY-MM-DD hh:mm:ss'
body: <p>I have a XSD schema for some RESTful service. When used in conjunction with <code>xsd.exe</code> tool to generate C# code, XSD's <code>xs:date</code> generates the following code:</p>
  
  <pre><code>[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="date")]
  public System.DateTime time {
      get {
          return this.timeField;
      }
      set {
          this.timeField = value;
      }
  }
  </code></pre>
  
  <p>When deserializing XML to objects using <code>XmlSerializer</code> all seems to be well. The problem I am facing is that the service expects dates to be formatted as <code>YYYY-MM-DD hh:mm:ss</code> and the XSD generated code seems to produce only <code>YYYY-MM-DD</code>.</p>
  
  <p>If I modify XSD manually to <code>xs:dateTime</code> type, the generated C# code produces: <code>2010-08-20T20:07:03.915039Z</code>.</p>
  
  <p>Basically, how do I force serialization to produce <code>YYYY-MM-DD hh:mm:ss</code>? Is there something to do to XSD or is there something I can do to alter generated C# code?</p>