I am looking for a library for Java or Scala allowing boolean composition of time intervals, to define periods like “Monday to Friday except 23:00—23:20 UTC”. Something like crontab interval definition, but with arbitrary compositions allowed. Is there anything like that?
Share
I don’t know if there is something exactly like that, but as a base you could look at JODA Time, an extensive Java Library for all kinds of Date/Time handling.
EDIT:
i just remembered that the Play! Framework uses CRON expressions. It contains a CRON expression parser that may be useful to you:
https://github.com/playframework/play/blob/master/framework/src/play/libs/Time.java
Also it got this parser from Quartz, an open source job scheduler, that may also be of interest to you: http://www.quartz-scheduler.org/