public class Time
extends java.lang.Object
Time expressions provide the ability to specify complex time combinations such as "2d", "1w2d3h10s" or "2d4h10s".
Constructor and Description |
---|
Time() |
Modifier and Type | Method and Description |
---|---|
static long |
cronInterval(java.lang.String cron)
Compute the number of milliseconds between the next valid date and the
one after
|
static long |
cronInterval(java.lang.String cron,
java.util.Date date)
Compute the number of milliseconds between the next valid date and the
one after
|
static java.util.Date |
parseCRONExpression(java.lang.String cron)
Parse a CRON expression
|
static int |
parseDuration(java.lang.String duration)
Parse a duration
|
public static int parseDuration(java.lang.String duration)
duration
- 3h, 2mn, 7s or combination 2d4h10s, 1w2d3h10spublic static java.util.Date parseCRONExpression(java.lang.String cron)
cron
- The CRON Stringpublic static long cronInterval(java.lang.String cron)
cron
- The CRON Stringpublic static long cronInterval(java.lang.String cron, java.util.Date date)
cron
- The CRON Stringdate
- The date to start searchGuillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly