Skip to content

Parsing cron syntax and getting next scheduled DateTime of joda-time

License

Notifications You must be signed in to change notification settings

buster84/scala-cron

Repository files navigation

scala-cron Build Status

The scala-cron can parse cron synstax string and compute nex time schedule.

Installation

build.sbt

libraryDependencies += "com.github.buster84" %% "scala-cron" % "1.0.0"

Usage

$ activator console
scala> import com.github.buster84.cron.Schedule
import com.github.buster84.cron.Schedule

scala> import org.joda.time._
import org.joda.time._

scala> val schedule = Schedule("0 10 * * *",DateTimeZone.forID("Asia/Tokyo"))
schedule: com.github.buster84.cron.Schedule = Schedule(0 10 * * *,Asia/Tokyo)

scala> schedule.getNextAfter(new DateTime( 2015, 2, 11, 2, 0, 0 ))
res2: org.joda.time.DateTime = 2015-02-11T10:00:00.000+09:00

License

Apache 2.0

About

Parsing cron syntax and getting next scheduled DateTime of joda-time

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages