title: GWT client - server SimpleDateFormat changes timezone to default
body: <p>I'm using GWT RPC to send a string containing a date from the client to the server (it has to be this way, because it's on a request header).</p>
  
  <p>On the server side I parse that string with SimpleDateFormat and make the logic I want. </p>
  
  <p>I'm setting both my cell phone and computer to different time zones, and will use hosted mode and running the test project on tom cat.</p>
  
  <p>Here's the code: </p>
  
  <p>Client: </p>
  
  <pre><code>DateTimeFormat dtf = DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss Z");
  Date date = new Date();
  
  System.out.println("client: " + date.toString());
  System.out.println("client: " + dtf.format(date));
  builder.setHeader("Date1", dtf.format(date));
  </code></pre>
  
  <p>Server: </p>
  
  <pre><code>String dateHeader = request.getHeader("Date1");
  System.out.println("Server date header from client: " + dateHeader);
  SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z");
  
  System.out.println("x = " + sdf.parse(dateHeader));
  System.out.println("Timezone = " + df.getTimeZone().getDisplayName());
  </code></pre>
  
  <p>Result:</p>
  
  <p><strong>Hosted Mode</strong><br>
  client: Wed Apr 11 17:29:49 NOVST 2012<br>
  client: 2012-04-11 17:29:49 +0700<br>
  Server date header from client: 2012-04-11 17:29:49 +0700<br>
  x = Wed Apr 11 17:29:49 NOVST 2012</p>
  
  <hr>
  
  <p><strong>TomCat</strong></p>
  
  <ol>
  <li>Using PC: Client, and server have the same time. </li>
  </ol>
  
  <p>(Can't see the print of the client, obviously)<br></p>
  
  <p>Server date header from client: 2012-04-11 17:31:37 +0700<br>
  x = Wed Apr 11 17:31:37 NOVST 2012</p>
  
  <ol>
  <li>Cellphone client, has a different from the server.</li>
  </ol>
  
  <p>Server date header from client: 2012-04-11 15:34:35 +0500<br>
  x = Wed Apr 11 17:34:35 NOVST 2012</p>
  
  <p>Conclusion:
  SimpleDateFormat ignores the Timezone that comes on the string. I don't want that! I want this to work properly. How can I make this work? Thank you in advanced.</p>