|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.twelvemonkeys.lang.DateUtil
public final class DateUtil
A utility class with useful date manipulation methods and constants.
| Field Summary | |
|---|---|
static long |
CALENDAR_YEAR
One calendar year: 365.2425 days (31556952000 milliseconds). |
static long |
DAY
One day: 24 hours (86 400 000 milliseconds). |
static long |
HOUR
One hour: 60 minutes (3 600 000 milliseconds). |
static long |
MINUTE
One minute: 60 seconds (60 000 milliseconds). |
static long |
SECOND
One second: 1000 milliseconds. |
| Method Summary | |
|---|---|
static long |
currentTimeDay()
Gets the current time, rounded down to the closest day. |
static long |
currentTimeHour()
Gets the current time, rounded down to the closest hour. |
static long |
currentTimeMinute()
Gets the current time, rounded down to the closest minute. |
static long |
currentTimeSecond()
Gets the current time, rounded down to the closest second. |
static long |
delta(Date pStart)
Returns the time between the given start time and now (as defined by System.currentTimeMillis()). |
static long |
delta(long pStart)
Returns the time between the given start time and now (as defined by System.currentTimeMillis()). |
static long |
roundToDay(long pTime)
Rounds the given time down to the closest day, using the default timezone. |
static long |
roundToDay(long pTime,
TimeZone pTimeZone)
Rounds the given time down to the closest day, using the given timezone. |
static long |
roundToHour(long pTime)
Rounds the given time down to the closest hour, using the default timezone. |
static long |
roundToMinute(long pTime)
Rounds the given time down to the closest minute. |
static long |
roundToSecond(long pTime)
Rounds the given time down to the closest second. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long SECOND
public static final long MINUTE
public static final long HOUR
public static final long DAY
public static final long CALENDAR_YEAR
| Method Detail |
|---|
public static long delta(long pStart)
System.currentTimeMillis()).
pStart - the start time
public static long delta(Date pStart)
System.currentTimeMillis()).
pStart - the start time
public static long currentTimeSecond()
roundToSecond(System.currentTimeMillis()).
public static long currentTimeMinute()
roundToMinute(System.currentTimeMillis()).
public static long currentTimeHour()
roundToHour(System.currentTimeMillis()).
public static long currentTimeDay()
roundToDay(System.currentTimeMillis()).
public static long roundToSecond(long pTime)
pTime - time
public static long roundToMinute(long pTime)
pTime - time
public static long roundToHour(long pTime)
pTime - time
public static long roundToDay(long pTime)
pTime - time
public static long roundToDay(long pTime,
TimeZone pTimeZone)
pTime - timepTimeZone - the timezone to use when rounding
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||