![]() ![]() This returns a LocalDate, based on this one, with the date adjusted. getChronology public IsoChronology getChronology().Specified by: getLong in interface TemporalAccessor Parameters: field - the field to get, not null Returns: the value for the field Throws: DateTimeException - if a value for the field cannot be obtained UnsupportedTemporalTypeException - if the field is not supported ArithmeticException - if numeric overflow occurs Gets the value of the specified field from this date as a long.Īnd what the value represents, is determined by the field. getLong public long getLong( TemporalField field).The range of values exceeds an int ArithmeticException - if numeric overflow occurs The value is outside the range of valid values for the field UnsupportedTemporalTypeException - if the field is not supported or Specified by: get in interface TemporalAccessor Parameters: field - the field to get, not null Returns: the value for the field Throws: DateTimeException - if a value for the field cannot be obtained or Whether the value can be obtained,Īnd what the value represents, is determined by the field. Is obtained by invoking TemporalField.getFrom(TemporalAccessor) Which are too large to fit in an int and throw a DateTimeException. Values based on this date, except EPOCH_DAY and PROLEPTIC_MONTH If it is not possible to return the value, because the field is not supported The returned value will always be within the valid range of values for the field. This queries this date for the value of the specified field. Gets the value of the specified field from this date as an int. get public int get( TemporalField field).Specified by: range in interface TemporalAccessor Parameters: field - the field to query the range for, not null Returns: the range of valid values for the field, not null Throws: DateTimeException - if the range for the field cannot be obtained UnsupportedTemporalTypeException - if the field is not supported Whether the range can be obtained is determined by the field. Is obtained by invoking TemporalField.rangeRefinedBy(TemporalAccessor) ![]() Or for some other reason, an exception is thrown.Īll other ChronoField instances will throw an UnsupportedTemporalTypeException. If it is not possible to return the range, because the field is not supported This date is used to enhance the accuracy of the returned range. The range object expresses the minimum and maximum valid values for a field. Gets the range of valid values for the specified field. isSupported public boolean isSupported( TemporalUnit unit). ![]() Specified by: isSupported in interface ChronoLocalDate Specified by: isSupported in interface TemporalAccessor Parameters: field - the field to check, null returns false Returns: true if the field is supported on this date, false if not Whether the field is supported is determined by the field. Is obtained by invoking TemporalField.isSupportedBy(TemporalAccessor) If the field is not a ChronoField, then the result of this method If the field is a ChronoField then the query is implemented here.Īll other ChronoField instances will return false. This checks if this date can be queried for the specified field. Since: 1.8 See Also: Serialized FormĬhecks if the specified field is supported. Implementation Requirements: This class is immutable and thread-safe. The equals method should be used for comparisons. LocalDate may have unpredictable results and should be avoided. ( =), identity hash code, or synchronization) on instances of To be accurate will find the ISO-8601 approach unsuitable.Ĭlass use of identity-sensitive operations (including reference equality However, any application that makes use of historical dates, and requires them System, in which today's rules for leap years are applied for all time.įor most applications written today, the ISO-8601 rules are entirely suitable. It is equivalent to the proleptic Gregorian calendar The ISO-8601 calendar system is the modern civil calendar system used today ![]() It cannot represent an instant on the time-line without additional information Instead, it is a description of the date, as used for birthdays. This class does not store or represent a time or time-zone. Other date fields, such as day-of-year,ĭay-of-week and week-of-year, can also be accessed.įor example, the value "2nd October 2007" can be stored in a LocalDate. LocalDate is an immutable date-time object that represents a date, A date without a time-zone in the ISO-8601 calendar system, ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |