|
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.DateOnly
DateOnly is the basic implementation of a date only class supporting chronologies and time zones. It holds the date as milliseconds from the Java epoch of 1970-01-01T00:00:00Z. There is no time component - the time is always 00:00:00.
Each individual field can be queried in two ways:
getYear()
year().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 | |
DateOnly(java.util.Calendar calendar,
Chronology chronology)
Constructs a DateOnly from a Calendar. |
|
DateOnly(Chronology chronology)
Constructs a DateOnly to the current date, as reported by the system clock. |
|
DateOnly(java.util.Date date,
Chronology chronology)
Constructs a DateOnly from a Date. |
|
DateOnly(long millis,
Chronology chronology)
Constructs a DateOnly set to the milliseconds from 1970-01-01T00:00:00Z. |
|
DateOnly(ReadableInstant instant,
Chronology chronology)
Constructs a DateOnly from a ReadableInstant. |
|
DateOnly(java.lang.String str,
Chronology chronology)
Constructs a DateOnly from an ISO formatted String. |
|
| Method Summary | |
DateTimeFieldProperty |
dayOfMonth()
Get the day of month property. |
DateTimeFieldProperty |
dayOfWeek()
Get the day of week property. |
DateTimeFieldProperty |
dayOfYear()
Get the day of year property. |
DateTimeFieldProperty |
era()
Get the era property. |
Chronology |
getChronology()
Gets the chronology of the date. |
int |
getDayOfMonth()
Get the day of month field value. |
int |
getDayOfWeek()
Get the day of week field value. |
int |
getDayOfYear()
Get the day of year field value. |
int |
getEra()
Get the era field value. |
int |
getLeapYear()
Get the leap year field value. |
long |
getMillis()
Gets the milliseconds of the date instant from the Java epoch of 1970-01-01T00:00:00Z. |
int |
getMonthOfYear()
Get the month of year field value. |
int |
getWeekOfYearWeek()
Get the week of year week field value. |
int |
getWeekOfYearYear()
Get the week of year year field value. |
int |
getYear()
Get the year field value. |
int |
getYearOfEra()
Get the year of era field value. |
DateTimeFieldProperty |
leapYear()
Get the leap year property. |
DateTimeFieldProperty |
monthOfYear()
Get the month of year property. |
java.lang.String |
toString()
Output the date time in ISO8601 date only format (YYYY-MM-DD). |
DateTimeFieldProperty |
weekOfYearWeek()
Get the week of year week property. |
DateTimeFieldProperty |
weekOfYearYear()
Get the week of year year property. |
DateTimeFieldProperty |
year()
Get the year property. |
DateTimeFieldProperty |
yearOfEra()
Get the year of era property. |
| 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 DateOnly(Chronology chronology)
DateTimeZone.getDefault().
chronology - the chronology, null is ISO
public DateOnly(long millis,
Chronology chronology)
DateTimeZone.getDefault().
millis - the millisecondschronology - the chronology, null is ISO
public DateOnly(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 DateOnly(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 DateOnly(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 DateOnly(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 getDayOfWeek()
public final int getDayOfMonth()
public final int getDayOfYear()
public final int getWeekOfYearWeek()
public final int getWeekOfYearYear()
public final int getMonthOfYear()
public final int getYear()
public final int getYearOfEra()
public final int getEra()
public final int getLeapYear()
public final DateTimeFieldProperty dayOfWeek()
public final DateTimeFieldProperty dayOfMonth()
public final DateTimeFieldProperty dayOfYear()
public final DateTimeFieldProperty weekOfYearWeek()
public final DateTimeFieldProperty weekOfYearYear()
public final DateTimeFieldProperty monthOfYear()
public final DateTimeFieldProperty year()
public final DateTimeFieldProperty yearOfEra()
public final DateTimeFieldProperty era()
public final DateTimeFieldProperty leapYear()
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 | ||||||||||