 <p>This is a bit hardcoded and pcalcao's answer is probably more flexible:</p> <pre><code>private static boolean isLessThan8HoursFrom2AM(DateTime date) { return (date.getHourOfDay() &gt;= 18 || date.getHourOfDay() &lt; 10); } </code></pre>