Daylight Savings Time (CST + CDT) - adding minutes issue
<p>I am updating a scheduling application with ability to repeat appointment dates into the future.  </p>

<p>The appointment future appointment time is figured out by finding the amount of minutes between the original appointment start time and end time.  So, for the instance the appointment is 120 mins long.  In the below code, a book time is a period of time in which appointments can be made.  So, the booktime and the appointments in it are getting copied.  This is one iteration of appointment copying.</p>

<pre><code>Calendar beginCalendar = Calendar.getInstance();
beginCalendar.setTime(newBookTime.getStartDate());
beginCalendar.add(Calendar.MINUTE, bookTimeDiffMinutes);

newAppointment.setStartDate(beginCalendar.getTime());
Calendar endCalendar = Calendar.getInstance();
endCalendar.setTime(newAppointment.getStartDate());
endCalendar.add(Calendar.MINUTE, appointmentDiffMinutes);
newAppointment.setStopDate(endCalendar.getTime());
</code></pre>

<p>The issue is that on the daylight savings day where CST turns into CDT ... if the start time of the appointment is say 11pm on the CST day and then end time on the CDT day say 2am ... my appointment ends an hour later or earlier (depending if they clocks are turning back or forward).   This is because when I add X mins for the appointment ... there is really say 1 less hour that day, because we skip an hour.</p>

<p>So, when I print the dates I can see on the DST day that the time zone changes from CST to CDT:</p>

<p>The book time should be from 20:00-6:00</p>

<pre><code>[STDOUT] The book time start date:Sat Mar 07 20:00:00 CST 2015
[STDOUT] The book time stop date:Sun Mar 08 07:00:00 CDT 2015
</code></pre>

<p>whereas on non-daylight savings change day we see: </p>

<pre><code>[STDOUT] The book time start date:Sun Mar 08 20:00:00 CDT 2015
[STDOUT] The book time stop date:Mon Mar 09 06:00:00 CDT 2015
</code></pre>

<p>I want to know how I can compensate for this and ensure my appointment and booktime are the correct length on the day that the timezone changes from CST to CDT.   If I had a smart way of detecting the change I could add or subtract 60 mins.</p>

<p>Looking for input.</p>
