A cronparser library inspired by the parse-cron Ruby gem. Cronparser.erl includes functionality to parse a crontab entry and compute the next occurrence of that entry, provided a given date time.
The full library is packaged as an OTP application and can be build, tested and added as a dependency using Rebar.
To parse a crontab line, use the time_specs function:
Spec = cronparser:time_specs("*/15 * * * *") .To compute the next occurrence of an spec, use the next function:
Now = calendar:local_time().
Next = cronparser:next(Now,Spec).To test and build the library, use Rebar:
rebar get-deps compile eunitThe library has a dependency on edate that will be automatically resolved by Rebar.
Released under the Apache License by Antonio Garrote (antoniogarrote@gmail.com), 2014.