title: Setting values of Java Calendar does not give expected date-time
body: <p>I have an hour, minute, date and millisecond timestamp, and am trying to create a Date object representing the time.  The timestamp is provided in Eastern Daylight Time.</p>
  
  <p>In dissecting the problem, I created some simple test code to see what was happening and have observed the following:</p>
  
  <pre><code>    Date today = new Date();
      int hour = 4, min  = 0, sec  = 0, ms   = 64;
      boolean print = true;
  
      Calendar cal = GregorianCalendar.getInstance();
      if(print)
          System.out.println("After initializing, time is: "+cal.getTime());
      cal.clear();
      if(print)
          System.out.println("After clearing, time is: "+cal.getTime());
      cal.setTime(today);
      if(print)
          System.out.println("After setting date, time is: "+cal.getTime());
      cal.set(Calendar.HOUR_OF_DAY,hour);
      if(print)
          System.out.println("After setting hour, time is: "+cal.getTime());
      cal.set(Calendar.MINUTE,min);
      if(print)
          System.out.println("After setting minute, time is: "+cal.getTime());
      cal.set(Calendar.SECOND,sec);
      if(print)
          System.out.println("After setting second, time is: "+cal.getTime());
      cal.set(Calendar.MILLISECOND,ms);
      if(print)
          System.out.println("After setting milliseconds, time is: "+cal.getTime());
      cal.setTimeZone(TimeZone.getTimeZone("EDT"));
  
      System.out.println("After setting time zone, time is: "+cal.getTime());
  </code></pre>
  
  <p>This produces the output:</p>
  
  <pre><code>After initializing, time is: Tue Jan 07 16:01:59 EST 2014
  After clearing, time is: Thu Jan 01 00:00:00 EST 1970
  After setting date, time is: Tue Jan 07 16:01:59 EST 2014
  After setting hour, time is: Tue Jan 07 04:01:59 EST 2014
  After setting minute, time is: Tue Jan 07 04:00:59 EST 2014
  After setting second, time is: Tue Jan 07 04:00:00 EST 2014
  After setting milliseconds, time is: Tue Jan 07 04:00:00 EST 2014
  After setting time zone, time is: Tue Jan 07 04:00:00 EST 2014
  </code></pre>
  
  <p>However, if I change the code slightly:</p>
  
  <pre><code>boolean print = false;
  </code></pre>
  
  <p>I get the following (different) result (!)</p>
  
  <pre><code>After setting time zone, time is: Mon Jan 06 23:00:00 EST 2014
  </code></pre>
  
  <p>Does anyone know why this is happening?</p>