title: How to convert date to the Brazilian standard using JAXB
body: <p>I'm having problem to convert the xml object using JAXB. The date is in the format <code>Sun Jan 30 16:08:23 BRT 18</code>, but need to convert to the Brazilian format <code>12-08-2009 16:08:23</code>. </p>
  
  <p>The input is coming in format <code>2009-08-12 16:08:23</code> and want output <code>12-08-2009 16:08:23</code>.</p>
  
  <p>Conversion class JAXB:</p>
  
  <pre><code>public class DateAdapter extends XmlAdapter&lt;String, Date&gt; {
  
      Locale brasil = new Locale("pt", "BR");
      private final SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss", brasil);
  
      @Override
      public String marshal(Date v) throws Exception {
          return dateFormat.format(v);
      }
  
      @Override
      public Date unmarshal(String v) throws Exception, ParseException {
          return dateFormat.parse(v);
      }
  }
  </code></pre>
  
  <p>Where i call the Adapter.</p>
  
  <pre><code>@XmlJavaTypeAdapter(DateAdapter.class)
  private Date ultima_atualizacaoProduto;
  </code></pre>