title: Is there a standard for inclusive/exclusive ends of time intervals?
body: <p>I'm wondering if there is a <em>standard</em> or "normal" means of interpreting time interval data end points with respect to inclusiveness/exclusiveness of the value defining the end point. Note however that I am asking what the standard (or most common) <strong><em>convention</em></strong> is (if there is one), not for a dissertation on your personal preference. If you really want to provide a dissertation, please attach it to a reference to someone's published standard or a standard text on the matter. Open standards (that I don't have to pay to read) are greatly preferred unless they are fundamentally flawed :).</p>
  
  <p>Of course there are 4 possibilities for a time interval from A to B:</p>
  
  <ol>
  <li>(A, B) - Both ends are exclusive.</li>
  <li>[A, B] - Both ends are inclusive.</li>
  <li>[A, B) - Start is inclusive and end is exclusive</li>
  <li>(A, B] - Start is exclusive and end is inclusive</li>
  </ol>
  
  <p>Each of these has different characteristics (as I see it, feel free to point out more)</p>
  
  <p>The [A, B] convention would have the seemingly inconvenient property that B is contained withing the inteval [A, B] and also [B, C]. This is particularly inconvenient if B is meant to represent the midnight boundary and you are trying to determine which day it falls on for example. Also, this means the duration of the interval is slightly irritatig to calculate since [A, B] where A = B should have a length of 1 and therefore the duration of [A, B] is (B - A) <strong>+ 1</strong> </p>
  
  <p>Similarly the (A, B) convention would have the difficulty that B falls within neither (A,B) nor (B,C)... continuing the analogy with day boundaries, midnight would be part of neither day. This is also logically inconvenient because [A, B] where A = B is a non-sense interval with duration less than zero, <strong>but reversing A and B does not make it a valid interval</strong>.</p>
  
  <p>So I think I want either [A, B), or (A, B] and I can't figure out how to decide between them. </p>
  
  <p>So if someone has a link to a standards document, reference to a standard text or similar  that clarify the convention that would be great. Alternately, if you can link a variety of standards documents and/or references that more or less completely fail to agree, then I can just pick one that seems to have sufficient authority to CMA and be done with it :). </p>
  
  <p>Finally, I will be working in Java, so I am particularly susceptible to answers that work well in Java.</p>