我想知道是否有人知道任何声明性语言来表示绝对日期-时间多间隔。我指的是时间间隔的并集/交集/补集。
我想表示的间隔如下:
(
(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))
) 我不是在寻找一个库,而是在寻找某种语言规范。
我正在寻找的一个示例是您可以找到here的cron表达式。
发布于 2015-09-03 17:48:09
似乎终于有人为此设计了一个领域特定语言:schyntax。
发布于 2009-07-16 12:45:37
您可能不是在寻找一个库,但是在使用Java的JODA库时,它的使用结构与您所展示的非常接近。一定要看着它。
发布于 2009-07-16 12:47:36
也许是SQL的一种方言?
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)https://stackoverflow.com/questions/1137298
复制相似问题