title: Joda Time LocalTime of 24:00 end-of-day
body: <p>We're creating a scheduling application and we need to represent someone's available schedule during the day, regardless of what time zone they are in. Taking a cue from Joda Time's Interval, which represents an interval in absolute time between two instances (start inclusive, end exclusive), we created a LocalInterval. The LocalInterval is made up of two LocalTimes (start inclusive, end exclusive), and we even made a handy class for persisting this in Hibernate.</p>
  
  <p>For example, if someone is available from 1:00pm to 5:00pm, we would create:</p>
  
  <pre><code>new LocalInterval(new LocalTime(13, 0), new LocalTime(17, 0));
  </code></pre>
  
  <p>So far so good---until someone wants to be available from 11:00pm until midnight on some day. Since the end of an interval is exclusive, this <em>should</em> be easily represented as such:</p>
  
  <pre><code>new LocalInterval(new LocalTime(23, 0), new LocalTime(24, 0));
  </code></pre>
  
  <p>Ack! No go. This throws an exception, because LocalTime cannot hold any hour greater than 23.</p>
  
  <p>This seems like a design flaw to me---Joda didn't consider that someone may want a LocalTime that represents a non-inclusive endpoint.</p>
  
  <p>This is really frustrating, as it blows a hole in what was otherwise a very elegant model that we created.</p>
  
  <p>What are my options---other than forking Joda and taking out the check for hour 24? (No, I don't like the option of using a dummy value---say 23:59:59---to represent 24:00.)</p>
  
  <p>Update: To those who keep saying that there is no such thing as 24:00, here's a quote from ISO 8601-2004 4.2.3 Notes 2,3: "The end of one calendar day [24:00] coincides with [00:00] at the start of the next calendar day ..." and "Representations where [hh] has the value [24] are only preferred to represent the end of a time interval ...."</p>