Whats the best java date recurrence pattern calculator

巧了我就是萌 提交于 2019-12-01 05:16:05

This is a frequent question on the joda time mailing list and the usual answer is to try RFC 2445. Disclaimer: I have not used it myself.

Check out Lamma date (I wrote it recently), which is designed to generate dates based on a recurrence pattern.

For example:

import static io.lamma.LammaJavaImports.*;
Dates.from(2010, 1, 1).to(2019, 12, 31).byYears(3).on(Locators.nth(3, FRIDAY).of(FEBRUARY)).build();

will generate the third Friday of February for every 3 years in 2010s

Output:

List(2010-02-19, 2013-02-15, 2016-02-19, 2019-02-15)
dlinsin

Check out Quartz, it's a really handy tool:

http://www.quartz-scheduler.org/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!