|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectccs.utils.TimeOfDay
public class TimeOfDay
Utility methods for events which occur at a fixed time of day.
Method Summary | |
---|---|
static int |
minutesSinceMidnight(long timeMillis,
java.util.Calendar cal)
Convert a time into the number of minutes since midnight. |
static int |
minutesSinceMidnight(java.lang.String time)
Convert a time into the number of minutes since midnight. |
static java.lang.String |
toString(int minutesSinceMidnight)
Convert a time offset since midnight into our string format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static int minutesSinceMidnight(java.lang.String time) throws java.lang.NumberFormatException
time
- The time to convert. The format is four digits
HHmm
, in 24-hour clock, with no punctuation between the
two components. Midnight is 0000, not 2400.
java.lang.NumberFormatException
- if time
does not conform to
the required format.public static int minutesSinceMidnight(long timeMillis, java.util.Calendar cal)
timeMillis
- The time to convert, in millseconds since the epoch.cal
- The calendar to go by. Calendar.getInstance
will
do in many cases. NB. The time of this calendar will be set.
public static java.lang.String toString(int minutesSinceMidnight)
minutesSinceMidnight
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |