|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.enblom.time.TimeUtils
public class TimeUtils
Utilities for dealing with Time
and similar objects.
Constructor Summary | |
---|---|
TimeUtils()
|
Method Summary | |
---|---|
static int |
differenceInDays(DayDate later,
DayDate earlier)
Calculates the difference in whole days between the two given date. |
static int |
differenceInDays(Time later,
Time earlier)
Calculates the difference in whole days between the two given times. |
static long |
differenceInMillis(TimeOfDay later,
TimeOfDay earlier)
Calculates the difference in milliseconds between the two given times of day. |
static long |
differenceInMillis(Time later,
Time earlier)
Calculates the difference in milliseconds between the two given times. |
static DayDate |
max(DayDate d1,
DayDate d2)
Finds the maximum of two dates. |
static TimeOfDay |
max(TimeOfDay t1,
TimeOfDay t2)
Finds the maximum of two times. |
static Time |
max(Time t1,
Time t2)
Finds the maximum of two times. |
static DayDate |
min(DayDate d1,
DayDate d2)
Finds the minimum of two dates. |
static TimeOfDay |
min(TimeOfDay t1,
TimeOfDay t2)
Finds the minimum of two times. |
static Time |
min(Time t1,
Time t2)
Finds the minimum of two times. |
static Time |
moveToTimeZone(Time time,
TimeZone timeZone,
TimeZone newTimeZone)
Given a time with a time zone, calculate the corresponding time in another time zone. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TimeUtils()
Method Detail |
---|
public static Time min(Time t1, Time t2)
t1
- The first time.t2
- The last time
public static Time max(Time t1, Time t2)
t1
- The first time.t2
- The last time
public static DayDate min(DayDate d1, DayDate d2)
d1
- The first date.d2
- The last date
public static DayDate max(DayDate d1, DayDate d2)
d1
- The first time.d2
- The last time
public static TimeOfDay min(TimeOfDay t1, TimeOfDay t2)
t1
- The first time.t2
- The last time
public static TimeOfDay max(TimeOfDay t1, TimeOfDay t2)
t1
- The first time.t2
- The last time
public static int differenceInDays(Time later, Time earlier)
later
- The first time to compare.earlier
- The second time to compare.
public static int differenceInDays(DayDate later, DayDate earlier)
later
- The first time to compare.earlier
- The second time to compare.
public static long differenceInMillis(Time later, Time earlier)
later
- The first time to compare.earlier
- The second time to compare.
public static long differenceInMillis(TimeOfDay later, TimeOfDay earlier)
later
- The first time to compare.earlier
- The second time to compare.
public static Time moveToTimeZone(Time time, TimeZone timeZone, TimeZone newTimeZone)
time
- The time.timeZone
- The time zone.newTimeZone
- The other time zone, to which the local time is moved.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |