title: How to get the current time in your timezone in Java
body: <p>I have no idea why Java makes it near impossible to do such a simple thing. I have tried many solutions I find online, but there doesn't seem to be a simple clean and working solution.</p>
  
  <p>Here is my latest attempt at a solution</p>
  
  <pre><code>SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
  
  Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("America/Los_Angeles"));
  System.out.println( sdf.format(calendar.getTime()) );
  </code></pre>
  
  <p>My excepted output: <code>27/02/2014 17:06:00</code></p>
  
  <p>My real output: <code>03/03/2014 20:35:44</code></p>
  
  <p>How does this even make any sense.</p>