title: Formatting ISO 8601 in Java 7
body: <p>I have date format like this <code>2016-11-25T09:29:10.588+01:00</code></p>
  
  <p>I want to convert this to <code>milliseconds</code> and later while printing I have to again convert milliseconds to "<code>yyyy-MM-dd HH:mm:ss.SSS</code>" this format.</p>
  
  <pre><code>static FastDateFormat alarmDateFormat = FastDateFormat.getInstance("yyyy-MM-dd HH:mm:ss.SSS");
  DateFormat df1 = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss.SSSXXX");
  df1.setTimeZone(TimeZone.getTimeZone("UTC"));
  String string1 = "2016-11-25T09:29:10.588+01:00";
  Date result1 = df1.parse(string1);
  long timeStamp = result1.getTime();
  System.out.println("timeStamp : " +timeStamp);
  String eventTime = alarmDateFormat.format(timeStamp);
  System.out.println("AfterConverting : " + eventTime);
  </code></pre>
  
  <p>Result : </p>
  
  <pre><code>timeStamp : 1480062550588
  AfterConverting : 2016-11-25 13:59:10.588
  </code></pre>
  
  <p><code>Date</code> is proper but the time is different. I have tried setting timezone to "UTC" but it did't help.</p>
  
  <p>Please note: In Java 8 it works fine with other libraries like Instant and all but we wanted in Java 7.</p>