title: Mapping Java Date Object to XML Schema datetime format
body: <p>I am having some problem mapping my Java Data Type to standard Schema Date data type.</p>
  
  <p>I have a simple class that I annotated like this.  The period instance variable is of Java Date object type.</p>
  
  <pre><code>@XmlAccessorType(value = XmlAccessType.NONE)
  public class Chart {
      @XmlElement
      private double amount;
      @XmlElement
      private double amountDue;
      @XmlElement
      private Date period;
      //constructor getters and setters
  }
  </code></pre>
  
  <p>Here is my Web Service</p>
  
  <pre><code>@WebService
  public class ChartFacade {
      @WebMethod
      public Chart getChart() throws ParseException {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-mm-dd");
        Chart chart = new Chart(20.0,20.5, df.parse("2001-01-01"));
        return chart;
      }
  }
  </code></pre>
  
  <p>My problem is it returns the date data in a format not according to what I am expecting.</p>
  
  <pre><code>&lt;S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"&gt;
     &lt;S:Body&gt;
        &lt;ns2:getChartResponse xmlns:ns2="http://ss.ugbu.oracle.com/"&gt;
           &lt;return&gt;
              &lt;amount&gt;20.0&lt;/amount&gt;
              &lt;amountDue&gt;20.5&lt;/amountDue&gt;
              **&lt;period&gt;2001-01-01T00:01:00+08:00&lt;/period&gt;**
           &lt;/return&gt;
        &lt;/ns2:getChartResponse&gt;
     &lt;/S:Body&gt;
  &lt;/S:Envelope&gt;
  </code></pre>
  
  <p>I wanted the period element to be returned like this</p>
  
  <pre><code>&lt;period&gt;2001-01-01&lt;/period&gt;
  </code></pre>
  
  <p>Is there any way I can achieve this?</p>