时间表符号(时间范围) [英] Schedule notation (time ranges)
问题描述
12/25:0730-1730 Do Y
[Mo-Fr] :0730-1730 Do X
[Mo-Tu]:1730-0730 Do Y
Fr:1730-Mo:0730 Do Y
肯定会有每周变化。年度变化(假期)似乎很可能。我想要一个高效灵活的符号。
我还需要java代码来解析时间段,并告诉我给定日期时间的范围。
我已经搜索到网页,没有发现任何内容。最近的是CRON符号,这不是我需要的。
任何一个现有的符号定义和实现知道?
谢谢,
对于Java Joda时间 (Scala包装器 scala-time )是一个强大的时间计算库。您可以查看 google-rfc-2445 ,这样做就像你要求(?)。
如果您正在寻找Java调度程序 http://www.quartz-scheduler.org/ 是一个很好的选择。
I have some code which needs to do things based on a schedule: e.g. during business hours do X, after hours do Y. The schedule will be defined by our customer's so I need a notation which can be written by people and parsed by my program. I'm thinking of something like:
12/25:0730-1730 Do Y
[Mo-Fr]:0730-1730 Do X
[Mo-Tu]:1730-0730 Do Y
Fr:1730-Mo:0730 Do Y
There will definitely be weekly variation. Yearly variation (holidays) seems likely. I would like a notation that is efficient and flexible.
I also need java code which will parse the time ranges and tell me which range a given date time is in.
I've searched the web and found nothing. Closest is CRON notation, which is not quite what I need.
Any one know of an existing notation definition and implementation?
Thanks,
For Java Joda time (Scala wrapper scala-time) is a powerful library for time calculations. You could look at the google-rfc-2445 which does something like what you are asking for (?).
If you are looking for a Java scheduler http://www.quartz-scheduler.org/ is a good option.
这篇关于时间表符号(时间范围)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!