views:

41

answers:

2

I'm wondering if anyone knows of any declarative language to express absolute date-time multi-intervals. I mean sets which are the union/intersection/complement of time intervals.

Intervals I would like to represent are like:

(
 (from the second day of the month to the 10th) intersection (months 1,2,3,10)
)
union
(
  (from the second monday of january to the 3rd of july) intersection (not in(mondays, fridays))  
)

I'm not looking for a library, but rather to some language specification.

An example of what I'm looking for are the cron expressions you can find here.

A: 

Well, you might not be looking for a library, but the JODA library for Java, when in use, comes close in structure of it's usage to what you have shown. Do look at it.

Daniel
A: 

A dialect of SQL, maybe?

Date from Days 
where Month in (Jan, Feb, Mar, Oct)
    and Day between 2 and 10

union

Date from Days
where Date between SecondMondayOf(Jan) and July,3
    and DayOfWeek not in (Mon, Fri)
Anton Gogolev
yes that's sort of what I'm looking for
mic.sca