title: How to convert date and time to user timezone
body: <pre><code>Calendar cal = Calendar.getInstance();
  cal.setTimeZone(TimeZone.getTimeZone("PST"));
  cal.setTime(new Date());
  
  SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss a");
  
  Date resultdate = new Date(cal.getTimeInMillis());
  sdf.setTimeZone(TimeZone.getTimeZone("PST"));
  
  System.out.println("String date:"+sdf.format(resultdate));
  System.out.println("Date:"+sdf.parse(sdf.format(resultdate)));
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>String date:2011-12-29 09:01:58 PM                                               
  Date:Fri Dec 30 10:31:58 IST 2011
  </code></pre>
  
  <p>Problem:</p>
  
  <ol>
  <li><code>sdf.format(resultdate)</code> returning correct date and time to as per timezone. But,</li>
  <li><code>sdf.parse(sdf.format(resultdate))</code> not returning correct date and time to as per timezone, how to fix this problem?</li>
  </ol>