title: android / java se SimpleDateFormat TimeZone issue
body: <p>I'm encountering a strange issue in a program running on android 2.1 which seems like a bug in android to me. Please enlighten me as to what is going here, as I'm lost. :)</p>
  
  <p>The following program:</p>
  
  <pre><code>import java.util.*;
  import java.text.*;
  
  class TestMe {
      public static void main(String[] args) {
              String time = "2010-08-01T18:00:00+0000";
  
              TimeZone tg = TimeZone.getDefault();
              System.out.println(tg.getID());
  
              SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
  
              try {
                  Date indate = formatter.parse(time);
  
                  String outdate = formatter.format(indate);
                  System.out.println(outdate);
  
                  formatter.setTimeZone( TimeZone.getTimeZone("UTC"));
  
                  String ooutdate = formatter.format(indate);
                      System.out.println(ooutdate);
  
                  formatter.setTimeZone( TimeZone.getDefault() );
                  Date ioutdate = formatter.parse(ooutdate);
                  System.out.println(formatter.format(ioutdate));
  
                  } catch( Exception e ) {
                      e.printStackTrace();
              }
          }
          }
  </code></pre>
  
  <p>returns this, when using latest java se on the mac:</p>
  
  <pre><code>(~) % javac -g TestMe.java &amp;&amp; java TestMe                                                                                                                                                                                                              
  Europe/Berlin
  2010-08-01T20:00:00+0200
  2010-08-01T18:00:00+0000
  2010-08-01T20:00:00+0200
  </code></pre>
  
  <p>but returns the following when I run it inside a method in my android app on 2.1 :</p>
  
  <pre><code>I/System.out( 5379): ------------------------------------------------------------------
  I/System.out( 5379): Europe/Berlin
  I/System.out( 5379): 2010-08-01T20:00:00+0200
  I/System.out( 5379): 2010-08-01T18:00:00+0100
  I/System.out( 5379): 2010-08-01T18:00:00+0100
  I/System.out( 5379): ------------------------------------------------------------------
  </code></pre>
  
  <p>Is anybody aware of problems in this specific android api revision with TimeZone and Date parsing? This is a very strange issue to me, as it the android version should return exactly the same as the java se version but doesn't. </p>
  
  <p>Thanks for any hints,</p>
  
  <p>Karsten</p>