public interface ReadableDateTime extends ReadableInstant
The implementation of this interface may be mutable or immutable. This interface only gives access to retrieve data, never to change it.
Methods in your application should be defined using ReadableDateTime
as a parameter if the method only wants to read the datetime, and not perform
any advanced manipulations.
Modifier and Type | Method and Description |
---|---|
int |
getCenturyOfEra()
Get the year of era field value.
|
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 |
getHourOfDay()
Get the hour of day field value.
|
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 |
getMonthOfYear()
Get the month of year field value.
|
int |
getSecondOfDay()
Get the second of day field value.
|
int |
getSecondOfMinute()
Get the second of minute field value.
|
int |
getWeekOfWeekyear()
Get the week of weekyear field value.
|
int |
getWeekyear()
Get the weekyear field value.
|
int |
getYear()
Get the year field value.
|
int |
getYearOfCentury()
Get the year of century field value.
|
int |
getYearOfEra()
Get the year of era field value.
|
DateTime |
toDateTime()
Get this object as a DateTime.
|
MutableDateTime |
toMutableDateTime()
Get this object as a MutableDateTime, always returning a new instance.
|
String |
toString(String pattern)
Output the instant using the specified format pattern.
|
String |
toString(String pattern,
Locale locale)
Output the instant using the specified format pattern.
|
equals, get, getChronology, getMillis, getZone, hashCode, isAfter, isBefore, isEqual, isSupported, toInstant, toString
compareTo
int getDayOfWeek()
The values for the day of week are defined in DateTimeConstants
.
int getDayOfMonth()
int getDayOfYear()
int getWeekOfWeekyear()
This field is associated with the "weekyear" via getWeekyear()
.
In the standard ISO8601 week algorithm, the first week of the year
is that in which at least 4 days are in the year. As a result of this
definition, day 1 of the first week may be in the previous year.
int getWeekyear()
The weekyear is the year that matches with the weekOfWeekyear field. In the standard ISO8601 week algorithm, the first week of the year is that in which at least 4 days are in the year. As a result of this definition, day 1 of the first week may be in the previous year. The weekyear allows you to query the effective year for that day.
int getMonthOfYear()
int getYear()
int getYearOfEra()
int getYearOfCentury()
int getCenturyOfEra()
int getEra()
int getMillisOfSecond()
int getMillisOfDay()
int getSecondOfMinute()
int getSecondOfDay()
int getMinuteOfHour()
int getMinuteOfDay()
int getHourOfDay()
DateTime toDateTime()
If the implementation of the interface is a DateTime, it is returned directly.
MutableDateTime toMutableDateTime()
String toString(String pattern) throws IllegalArgumentException
pattern
- pattern specificationIllegalArgumentException
- if pattern is invalidDateTimeFormat
String toString(String pattern, Locale locale) throws IllegalArgumentException
pattern
- pattern specificationlocale
- Locale to use, or null for defaultIllegalArgumentException
- if pattern is invalidDateTimeFormat
Copyright © 2002–2024 Joda.org. All rights reserved.