Package play.libs
Class Time
java.lang.Object
play.libs.Time
Time utilities.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThanks to Quartz project, https://quartz.dev.java.net -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longcronInterval(String cron) Computes the number of milliseconds between the next valid date and the one after.static longcronInterval(String cron, Date date) Compute the number of milliseconds between the next valid date and the one after.static DateparseCRONExpression(String cron) Parses a CRON expression.static intparseDuration(String duration) Parses a duration.
-
Constructor Details
-
Time
public Time()
-
-
Method Details
-
parseDuration
Parses a duration.- Parameters:
duration- a quantity of time, such as 3h, 2mn, 7s- Returns:
- the length of the duration in seconds
-
parseCRONExpression
Parses a CRON expression.- Parameters:
cron- the CRON String- Returns:
- the next
Datethat satisfies the expression
-
cronInterval
Computes the number of milliseconds between the next valid date and the one after.- Parameters:
cron- the CRON String- Returns:
- the number of milliseconds between the next valid date and the one after, with an invalid interval between
-
cronInterval
Compute the number of milliseconds between the next valid date and the one after.- Parameters:
cron- the CRON Stringdate- the date to start search- Returns:
- the number of milliseconds between the next valid date and the one after, with an invalid interval between
-