title: Android: Change timezone of date string
body: <p>I've been trying this for about an hour now but it doesn't seem to be working properly.</p>
  
  <p>I'm basically reading a date string from a database, it's in the format yyyy-MM-dd HH:mm:ss (2012-03-01 14:32:00).</p>
  
  <p>At this point all I have is the string, no timezone info. This time is created on our server, and eventually gets into the device database, I know for a fact that it's Eastern Standard Time.</p>
  
  <p>So I basically tried the following code:</p>
  
  <pre><code>SimpleDateFormat sourceFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 
          sourceFormat.setTimeZone(TimeZone.getTimeZone("EST"));
  
          Date parsed = sourceFormat.parse("2012-03-01 10:18:14"); 
  
          TimeZone tz = TimeZone.getDefault(); 
          SimpleDateFormat destFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 
          destFormat.setTimeZone(tz);  
  
          String result = destFormat.format(parsed);
  
          Log.v("TZ", result);
  </code></pre>
  
  <p>My emulator is EST so when I log the time it shows 2012-03-01 10:18:14, which is correct.</p>
  
  <p>But if I change the time zone of sourceFormat to say America/Los Angeles I get an output of 2012-03-01 05:18:14.</p>
  
  <p>Now I'm not an expert but I'm pretty sure Los Angeles is 3 hours behind Montreal (EST where our office is located). So if I take the time 2012-03-01 10:18:14 and call it America/Los Angeles time, then convert that to EST I expect to see 2012-03-01 13:18:14.</p>
  
  <p>What's happening?</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Thanks a lot.</p>