Interface ITemporalItem

All Superinterfaces:
IAnyAtomicItem, IAtomicValuedItem, ICollectionValue, IItem
All Known Subinterfaces:
ICalendarTemporalItem, IDateItem, IDateTimeItem, IDateTimeWithTimeZoneItem, IDateWithTimeZoneItem, ITimeItem, ITimeWithTimeZoneItem

public interface ITemporalItem extends IAnyAtomicItem
An atomic Metapath item containing a temporal data value.
  • Method Details

    • getYear

      int getYear()
      Get the year value of this temporal.
      Returns:
      the year value
    • getMonth

      int getMonth()
      Get the month value of this temporal.
      Returns:
      the month value
    • getDay

      int getDay()
      Get the day value of this temporal.
      Returns:
      the day value
    • getHour

      int getHour()
      Get the hour value of this temporal.
      Returns:
      the hour value
    • getMinute

      int getMinute()
      Get the minute value of this temporal.
      Returns:
      the minute value
    • getSecond

      int getSecond()
      Get the whole second value of this temporal.
      Returns:
      the whole second value
    • getNano

      int getNano()
      Get the partial nano second value of this temporal.
      Returns:
      the partial nano second value
    • getZoneOffset

      @Nullable ZoneOffset getZoneOffset()
      Get the timezone offset for this temporal.
      Returns:
      the timezone offset if specified or null if the timezone is not known
      See Also:
    • getOffset

      @Nullable default IDayTimeDurationItem getOffset()
      Get the timezone offset as a day/time duration for this temporal.
      Returns:
      the timezone offset if specified or null if the timezone is not known
      See Also:
    • hasTimezone

      boolean hasTimezone()
      Determine if the temporal item has a timezone.
      Returns:
      true if the temporal item has a timezone or false otherwise
    • hasDate

      boolean hasDate()
      Determine if the temporal has date information.
      Returns:
      true if the temporal item has date information or false otherwise
    • hasTime

      boolean hasTime()
      Determine if the temporal has time information.
      Returns:
      true if the temporal item has time information or false otherwise
    • replaceTimezone

      @NonNull ITemporalItem replaceTimezone(@Nullable IDayTimeDurationItem offset)
      Adjusts a temporal item value to a specific timezone, or to no timezone at all.
      Parameters:
      offset - the timezone offset to use or null
      Returns:
      the adjusted temporal value
      Throws:
      DateTimeFunctionException - with code DateTimeFunctionException.INVALID_TIME_ZONE_VALUE_ERROR if the offset is < -PT14H or > PT14H