|
Joda Time API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.joda.time.AbstractInstant
|
+--org.joda.time.TimeOnly
TimeOnly is the basic implementation of a time only class supporting chronologies and time zones. It holds the time as milliseconds from the Epoch of 1970-01-01T00:00:00Z. There is no date component - the date is always 1970-01-01.
Each individual field can be queried in two ways:
getHourOfDay()
hourOfDay().get()
This class is immutable provided that the Chronology is immutable. All Chronology classes supplied are immutable.
ISOChronology,
ISODateTimeFormat,
DateTimeZone.UTC,
Serialized Form| Constructor Summary | |
TimeOnly(java.util.Calendar calendar,
Chronology chronology)
Constructs a TimeOnly from a Calendar. |
|
TimeOnly(Chronology chronology)
Constructs a TimeOnly to the current time, as reported by the system clock. |
|
TimeOnly(java.util.Date date,
Chronology chronology)
Constructs a TimeOnly from a Date. |
|
TimeOnly(long millis,
Chronology chronology)
Constructs a TimeOnly set to the milliseconds from 1970-01-01T00:00:00Z. |
|
TimeOnly(ReadableInstant instant,
Chronology chronology)
Constructs a TimeOnly from a ReadableInstant. |
|
TimeOnly(java.lang.String str,
Chronology chronology)
Constructs a TimeOnly from an ISO formatted String. |
|
| Method Summary | |
Chronology |
getChronology()
Gets the chronology of the time. |
int |
getHourOfDay()
Get the hour of day field value. |
long |
getMillis()
Gets the milliseconds of the time instant from the Java epoch of 1970-01-01T00:00:00Z. |
int |
getMillisOfDay()
Get the millis of day field value. |
int |
getMillisOfSecond()
Get the millis of second field value. |
int |
getMinuteOfDay()
Get the minute of day field value. |
int |
getMinuteOfHour()
Get the minute of hour field value. |
int |
getSecondOfDay()
Get the second of day field value. |
int |
getSecondOfMinute()
Get the second of minute field value. |
DateTimeFieldProperty |
hourOfDay()
Get the hour of day field property. |
DateTimeFieldProperty |
millisOfDay()
Get the millis of day property. |
DateTimeFieldProperty |
millisOfSecond()
Get the millis of second property. |
DateTimeFieldProperty |
minuteOfDay()
Get the minute of day property. |
DateTimeFieldProperty |
minuteOfHour()
Get the minute of hour field property. |
DateTimeFieldProperty |
secondOfDay()
Get the second of day property. |
DateTimeFieldProperty |
secondOfMinute()
Get the second of minute field property. |
java.lang.String |
toString()
Output the date time in ISO8601 format (HH:MM:SS.SSSZ). |
| Methods inherited from class org.joda.time.AbstractInstant |
compareTo, equals, get, hashCode, isAfter, isBefore, isEqual, toCalendar, toDate, toGregorianCalendar, toInstant |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public TimeOnly(Chronology chronology)
DateTimeZone.getDefault().
chronology - the chronology, null is ISO
public TimeOnly(long millis,
Chronology chronology)
DateTimeZone.getDefault().
millis - the millisecondschronology - the chronology, null is ISO
public TimeOnly(ReadableInstant instant,
Chronology chronology)
DateTimeZone.getDefault().
instant - the ReadableInstant, must not be nullchronology - the chronology, null means use instant to determine
java.lang.IllegalArgumentException - if the instant is null
public TimeOnly(java.util.Date date,
Chronology chronology)
DateTimeZone.getDefault().
date - the Date, must not be nullchronology - the chronology, null is ISO
java.lang.IllegalArgumentException - if the date is null
public TimeOnly(java.util.Calendar calendar,
Chronology chronology)
If the chronology is specified, it is used. If null, the chronology and time zone from the calendar is used. If that cannot be determined, ISOChronology in the default time zone is used.
When converting calendars to chronologies, the constructor is aware of GregorianCalendar and BuddhistCalendar and maps them to the equivalent chronology. Other calendars map to ISOChronology.
calendar - the Calendar, must not be nullchronology - the chronology, null means use calendar to determine
java.lang.IllegalArgumentException - if the calendar is null
public TimeOnly(java.lang.String str,
Chronology chronology)
throws java.text.ParseException
DateTimeZone.getDefault().
str - the string to parse, must not be nullchronology - the chronology, null is ISO
java.lang.IllegalArgumentException - if the string is null
java.text.ParseException - if parsing fails| Method Detail |
public final long getMillis()
public final Chronology getChronology()
public final int getMillisOfSecond()
public final int getMillisOfDay()
public final int getSecondOfMinute()
public final int getSecondOfDay()
public final int getMinuteOfHour()
public final int getMinuteOfDay()
public final int getHourOfDay()
public final DateTimeFieldProperty millisOfSecond()
public final DateTimeFieldProperty millisOfDay()
public final DateTimeFieldProperty secondOfMinute()
public final DateTimeFieldProperty secondOfDay()
public final DateTimeFieldProperty minuteOfHour()
public final DateTimeFieldProperty minuteOfDay()
public final DateTimeFieldProperty hourOfDay()
public final java.lang.String toString()
toString in interface ReadableInstanttoString in class java.lang.Object
|
Joda Time API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||