play.libs
类 Time

java.lang.Object
  继承者 play.libs.Time

public class Time
extends java.lang.Object

Time utils


嵌套类摘要
static class Time.CronExpression
          Thanks to Quartz project, https://quartz.dev.java.net Provides a parser and evaluator for unix-like cron expressions.
 
构造方法摘要
Time()
           
 
方法摘要
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
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

Time

public Time()
方法详细信息

parseDuration

public static int parseDuration(java.lang.String duration)
Parse a duration

参数:
duration - 3h, 2mn, 7s
返回:
The number of seconds

parseCRONExpression

public static java.util.Date parseCRONExpression(java.lang.String cron)
Parse a CRON expression

参数:
cron - The CRON String
返回:
The next Date that satisfy the expression

cronInterval

public static long cronInterval(java.lang.String cron)
Compute the number of milliseconds between the next valid date and the one after

参数:
cron - The CRON String
返回:
the number of milliseconds between the next valid date and the one after, with an invalid interval between

cronInterval

public 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

参数:
cron - The CRON String
date - The date to start search
返回:
the number of milliseconds between the next valid date and the one after, with an invalid interval between


Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly