title: Java TimeZone with DST
body: <p>I have the following code:</p>
  
  <pre><code>    public static void main(String[] args) {
         DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
     //get current date time with Date()
         Date date = new Date();
         String currentDate = dateFormat.format(date);
  
         final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
           try {
              System.out.println(sdf.format(getSomeDate(currentDate,TimeZone.getTimeZone("Asia/Omsk"))));
           } catch (ParseException e) {
           // TODO Auto-generated catch block
           e.printStackTrace();
         }  
      }
  
      public static Date getSomeDate(final String str, final TimeZone tz) throws ParseException {
         final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
         sdf.setTimeZone(tz);
         return sdf.parse(str);
      }
  </code></pre>
  
  <p>Now the problem with it is, if I use the timezone I want (which is "America/Chicago"), I get the completely wrong time. It does the current time +6 instead of -6.</p>
  
  <p>So how would I be able to fix this, because now I have to put a timezone from GMT + 6 to get the correct time &amp; date for my program.</p>
  
  <p>Also, does Java automatically incorporates the DST settings? As this is used by people from all around the world so some with the different DST times, it's hard to keep the right time.</p>