org.ijsberg.iglu.util.time
Class TimeSupport
java.lang.Object
org.ijsberg.iglu.util.time.TimeSupport
- Direct Known Subclasses:
- SchedulingSupport
public abstract class TimeSupport
- extends Object
Contains convenience methods concerning time, date and scheduling.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SECOND_IN_MS
public static final int SECOND_IN_MS
- See Also:
- Constant Field Values
MINUTE_IN_MS
public static final int MINUTE_IN_MS
- See Also:
- Constant Field Values
HALF_MINUTE_IN_MS
public static final int HALF_MINUTE_IN_MS
- See Also:
- Constant Field Values
HOUR_IN_MS
public static final int HOUR_IN_MS
- See Also:
- Constant Field Values
DAY_IN_MS
public static final int DAY_IN_MS
- See Also:
- Constant Field Values
DAY_IN_MINS
public static final int DAY_IN_MINS
- See Also:
- Constant Field Values
LOCAL_UTC_OFFSET
public static final long LOCAL_UTC_OFFSET
LOCAL_UTC_OFFSET_IN_MINUTES
public static final long LOCAL_UTC_OFFSET_IN_MINUTES
TimeSupport
public TimeSupport()
getUtcOffset
public static long getUtcOffset(Calendar cal)
- Returns:
- offset from UTC in milliseconds
isToday
public static boolean isToday(Date date)
- Parameters:
date -
- Returns:
- true if the given date happens to be today
isBeforeToday
public static boolean isBeforeToday(Date date)
- Parameters:
date -
- Returns:
- true if the given date is on a day earlier than today
isAfterToday
public static boolean isAfterToday(Date date)
- Parameters:
date -
- Returns:
- true if the given date is on a day later than today
isSameDay
public static boolean isSameDay(long time1,
long time2)
- Parameters:
time1 - time in millistime2 - time in millis
- Returns:
- true if the two specified times are part of the same day
isSameWeek
public static boolean isSameWeek(long time1,
long time2)
- Parameters:
time1 - time in millistime2 - time in millis
- Returns:
- true if the two specified times are part of the same week
roundToMinute
public static long roundToMinute(long time)
- Parameters:
time - time in millis
- Returns:
- time in milles rounded to the minute
getMinutesSinceMidnight
public static int getMinutesSinceMidnight()
- Returns:
- The number of minutes passed since 00:00 hours
getMinutesSinceMidnight
public static int getMinutesSinceMidnight(long time)
- Parameters:
time -
- Returns:
- the number of minutes passed since 00:00 hours in current time zone
Copyright © 2012. All Rights Reserved.