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) The OFFSET_SECONDS field returns the value of the offset. 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 offset for the value of the specified field. Gets the value of the specified field from this offset 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) 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 throw an UnsupportedTemporalTypeException. Or for some other reason, an exception is thrown. If it is not possible to return the range, because the field is not supported This offset 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. Implementation Requirements: This class is immutable and thread-safe. The equals method should be used for comparisons. ZoneOffset may have unpredictable results and should be avoided. ( =), identity hash code, or synchronization) on instances of Implementations may choose to cache certain common offsets, howeverĪpplications must not rely on such caching.Ĭlass use of identity-sensitive operations (including reference equality Instances of ZoneOffset must be compared using equals(). This class may be used with otherĬalendar systems providing the definition of the time fields matches those Standard ISO definitions of those fields. The fields of hours, minutes and seconds make assumptions that are valid for the This class is designed for use with the ISO calendar system. Validation, the range of offsets is restricted to -18:00 to 18:00 inclusive. To prevent any problems with that range being extended, yet still provide In 2008, time-zone offsets around the world extended from -12:00 to +14:00. ZoneOffset instances - a +01:00 instance for winter, The ZoneId instance for Paris will reference two The rules for how offsets vary by place and time of year are captured in theįor example, Paris is one hour ahead of Greenwich/UTC in winter and two hoursĪhead in summer. This is usually a fixed number of hours and minutes.ĭifferent parts of the world have different time-zone offsets. A time-zone offset from Greenwich/UTC, such as +02:00.Ī time-zone offset is the amount of time that a time-zone differs from Greenwich/UTC.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |