title: Convert java.util.Calendar ISO 8601 format to java.sql.Timestamp
body: <p>I have a date in ISO 8601 date format <code>2015-09-08T01:55:28Z</code>. I used this code to convert the ISO 8601 fate to a Calendar object:</p>
  
  <pre><code>Calendar cal = javax.xml.bind.DatatypeConverter.parseDateTime("2015-09-08T01:55:28Z");
  </code></pre>
  
  <p>and now I need to use the <code>cal.getTime()</code> to get my time, but I need to convert it to a <code>java.sql.Timestamp</code>. I tried to do this:</p>
  
  <pre><code>final Timestamp finalDate = (Timestamp) cal.getTime();
  </code></pre>
  
  <p>but I got this error: </p>
  
  <pre><code>java.lang.ClassCastException: java.util.Date cannot be cast to java.sql.Timestamp
  </code></pre>
  
  <p>Ideas?</p>