title: Joda - the right way to get daylight savings independent times
body: <p>I'm working on some alarm functionality and I'm using Joda to calculate the millis for each alarm time. I have some utility methods, like:</p>
  
  <pre><code> public static DateTime getNextDateTimeWithHourMinute(int hour, int minute) {
      DateTime now = new DateTime();
      DateTime then = now
              .withHourOfDay(hour)
              .withMinuteOfHour(minute)
              .withSecondOfMinute(0)
              .withMillisOfSecond(0);
  
      return then.isBefore(now) ? then.plusDays(1) : then;
  }
  </code></pre>
  
  <p>which calculates the next occurence of some hour and minute for me. Problem is, if we try to get, for instance, 2:00 am which of March 10, then we'll get a </p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException: Illegal instant due to time zone
    offset transition: 2013-03-10T07:00:00.000</p>
  </blockquote>
  
  <p>I know that in this case that time simply doesn't exist, but is there is a simple way to determine that between there's some transition occuring between <code>now</code> and <code>then</code> and then automatically make corrections. Obviously the corrections depend on your use case. In my case, I'd like it to be so that if the clock is falling back between now and then that I get a DateTime object delayed by an hour. In other words, if the user set an alarm for 3 am, for example, and then the clock moves backward around that time, that the alarm will fire when the clock time reads 3 am (which is now an hour later). Sorry for rant, hope this question makes some sense. </p>