net.jot.scheduler
Class JOTClock

java.lang.Object
  extended by net.jot.scheduler.JOTClock

public class JOTClock
extends java.lang.Object

Collection of utilities related to Date/Time

Author:
tcolar

Field Summary
static java.text.DateFormat TIMESTAMP_FORMAT
           
static java.util.regex.Pattern TIMESTAMP_PATTERN
           
static java.text.DateFormat TIMESTAMP_WITH_MS_FORMAT
           
 
Constructor Summary
JOTClock()
           
 
Method Summary
static java.util.Date getCurrentDate()
          Gets the current Date
static long getCurrentTime()
          Gets the current Time in ms since 1970
static java.lang.String getDateString()
          Same, but without milliseconds
static java.lang.String getDateStringWithMs()
          return the date in a fomat containing no spaces, mainly used as part of file names
static int getField(int field)
           
static java.util.Calendar getNow()
           
static java.util.Date parseDateString(java.lang.String s)
          parse a date string created by getDateString of getDateStringWithMs back into a Date object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TIMESTAMP_FORMAT

public static final java.text.DateFormat TIMESTAMP_FORMAT

TIMESTAMP_WITH_MS_FORMAT

public static final java.text.DateFormat TIMESTAMP_WITH_MS_FORMAT

TIMESTAMP_PATTERN

public static final java.util.regex.Pattern TIMESTAMP_PATTERN
Constructor Detail

JOTClock

public JOTClock()
Method Detail

getCurrentDate

public static java.util.Date getCurrentDate()
Gets the current Date

Returns:
The currentDate value
Since:

getField

public static int getField(int field)

getNow

public static java.util.Calendar getNow()

getCurrentTime

public static long getCurrentTime()
Gets the current Time in ms since 1970

Returns:
The currentTime value
Since:

getDateStringWithMs

public static java.lang.String getDateStringWithMs()
return the date in a fomat containing no spaces, mainly used as part of file names

Returns:

getDateString

public static java.lang.String getDateString()
Same, but without milliseconds

Returns:

parseDateString

public static java.util.Date parseDateString(java.lang.String s)
                                      throws java.text.ParseException
parse a date string created by getDateString of getDateStringWithMs back into a Date object

Parameters:
s -
Returns:
Throws:
java.text.ParseException