Class TemporalBuiltinFunctions

java.lang.Object
org.daiitech.naftah.builtin.functions.TemporalBuiltinFunctions

public final class TemporalBuiltinFunctions extends Object
Provider for built-in temporal functions. Contains functions to create, manipulate, and query durations, periods, and period-with-duration objects.

All functions are static; this class cannot be instantiated.

Author:
Chakib Daii
  • Constructor Details

    • TemporalBuiltinFunctions

      private TemporalBuiltinFunctions()
      Private constructor to prevent instantiation. Throws NaftahBugError if called.
  • Method Details

    • currentTime

      public static NaftahTime currentTime()
      Obtains the current time using the system default time zone.
      Returns:
      the current NaftahTime
    • currentZonedTime

      public static NaftahTime currentZonedTime(String zone)
      Obtains the current time using the specified time zone.
      Parameters:
      zone - the zone ID (e.g. Asia/Dubai)
      Returns:
      the current NaftahTime
    • currentOffsetTime

      public static NaftahTime currentOffsetTime(String offset)
      Obtains the current time using a fixed offset.
      Parameters:
      offset - the offset (e.g. +04:00)
      Returns:
      the current NaftahTime
    • createTime

      public static NaftahTime createTime(Number hour, Number minute)
      Creates an NaftahTime instance from hour and minute.
      Parameters:
      hour - the hour value
      minute - the minute value
      Returns:
      a new NaftahTime instance
    • createZonedTime

      public static NaftahTime createZonedTime(Number hour, Number minute, String zone)
      Creates a zoned NaftahTime instance from hour, minute, and time zone.
      Parameters:
      hour - the hour value
      minute - the minute value
      zone - the time zone ID (e.g. "Asia/Riyadh")
      Returns:
      a new NaftahTime instance with the specified zone
    • createOffsetTime

      public static NaftahTime createOffsetTime(Number hour, Number minute, String offset)
      Creates an offset NaftahTime instance from hour, minute, and offset.
      Parameters:
      hour - the hour value
      minute - the minute value
      offset - the offset string (e.g. "+04:00")
      Returns:
      a new NaftahTime instance with the specified offset
    • createTime

      public static NaftahTime createTime(Number hour, Number minute, Number second)
      Creates an NaftahTime instance from hour, minute, and second.
      Parameters:
      hour - the hour value
      minute - the minute value
      second - the second value
      Returns:
      a new NaftahTime instance
    • createZonedTime

      public static NaftahTime createZonedTime(Number hour, Number minute, Number second, String zone)
      Creates a zoned NaftahTime instance from hour, minute, second, and zone.
      Parameters:
      hour - the hour value
      minute - the minute value
      second - the second value
      zone - the time zone ID
      Returns:
      a new NaftahTime instance with the specified zone
    • createOffsetTime

      public static NaftahTime createOffsetTime(Number hour, Number minute, Number second, String offset)
      Creates an offset NaftahTime instance from hour, minute, second, and offset.
      Parameters:
      hour - the hour value
      minute - the minute value
      second - the second value
      offset - the offset string
      Returns:
      a new NaftahTime instance with the specified offset
    • createTime

      public static NaftahTime createTime(Number hour, Number minute, Number second, Number nanoOfSecond)
      Creates an NaftahTime instance from hour, minute, second, and nanosecond.
      Parameters:
      hour - the hour value
      minute - the minute value
      second - the second value
      nanoOfSecond - the nanosecond value
      Returns:
      a new NaftahTime instance
    • createZonedTime

      public static NaftahTime createZonedTime(Number hour, Number minute, Number second, Number nanoOfSecond, String zone)
      Creates an NaftahTime instance from hour, minute, second, and nanosecond with a specific time zone.
      Parameters:
      hour - the hour value
      minute - the minute value
      second - the second value
      nanoOfSecond - the nanosecond value
      zone - the time zone ID (e.g., "Asia/Riyadh")
      Returns:
      a new NaftahTime instance with the specified zone
    • createOffsetTime

      public static NaftahTime createOffsetTime(Number hour, Number minute, Number second, Number nanoOfSecond, String offset)
      Creates an NaftahTime instance from hour, minute, second, and nanosecond with a specific offset.
      Parameters:
      hour - the hour value
      minute - the minute value
      second - the second value
      nanoOfSecond - the nanosecond value
      offset - the offset string (e.g., "+03:00")
      Returns:
      a new NaftahTime instance with the specified offset
    • createTimeOfSecondOfDay

      public static NaftahTime createTimeOfSecondOfDay(Number secondOfDay)
      Creates an NaftahTime instance from the total number of seconds since midnight.
      Parameters:
      secondOfDay - the total number of seconds since midnight (0–86,399)
      Returns:
      a new NaftahTime instance
    • createZonedTimeOfSecondOfDay

      public static NaftahTime createZonedTimeOfSecondOfDay(Number secondOfDay, String zone)
      Creates an NaftahTime instance from the total number of seconds since midnight with a specific time * zone.
      Parameters:
      secondOfDay - the second-of-day (0–86,399)
      zone - the time zone ID (e.g., "Asia/Riyadh")
      Returns:
      a new NaftahTime instance with the specified zone
    • createOffsetTimeOfSecondOfDay

      public static NaftahTime createOffsetTimeOfSecondOfDay(Number secondOfDay, String offset)
      Creates an NaftahTime instance from the total number of seconds since midnight with a specific offset.
      Parameters:
      secondOfDay - the second-of-day (0–86,399)
      offset - the offset (e.g., "+04:00")
      Returns:
      a new NaftahTime instance with the specified offset
    • createTimeOfNanoOfDay

      public static NaftahTime createTimeOfNanoOfDay(Number nanoOfDay)
      Creates an NaftahTime instance from the total number of nanoseconds since midnight.
      Parameters:
      nanoOfDay - the nano-of-day (0–86,399,999,999,999)
      Returns:
      a new NaftahTime instance
    • createZonedTimeOfNanoOfDay

      public static NaftahTime createZonedTimeOfNanoOfDay(Number nanoOfDay, String zone)
      Creates an NaftahTime instance from the total number of nanoseconds since midnight with a specific time zone.
      Parameters:
      nanoOfDay - the nano-of-day (0–86,399,999,999,999)
      zone - the time zone ID (e.g., "Asia/Riyadh")
      Returns:
      a new NaftahTime instance with the specified zone
    • createOffsetTimeOfNanoOfDay

      public static NaftahTime createOffsetTimeOfNanoOfDay(Number nanoOfDay, String offset)
      Creates an NaftahTime instance from the total number of nanoseconds since midnight with a fixed offset.
      Parameters:
      nanoOfDay - the nano-of-day (0–86,399,999,999,999)
      offset - the offset (e.g., "+04:00")
      Returns:
      a new NaftahTime instance with the specified offset
    • currentDate

      public static NaftahDate currentDate()
      Obtains the current date using the default chronology.
      Returns:
      the current NaftahDate
    • currentChronologyDate

      public static NaftahDate currentChronologyDate(String chronology)
      Obtains the current date using the specified chronology.
      Parameters:
      chronology - the chronology name
      Returns:
      the current NaftahDate
    • currentZonedDate

      public static NaftahDate currentZonedDate(String zone)
      Obtains the current date using the specified time zone.
      Parameters:
      zone - the zone ID (e.g. Asia/Dubai)
      Returns:
      the current NaftahDate
    • currentOffsetDate

      public static NaftahDate currentOffsetDate(String offset)
      Obtains the current date using a fixed offset.
      Parameters:
      offset - the offset (e.g. +04:00)
      Returns:
      the current NaftahDate
    • currentZonedChronologyDate

      public static NaftahDate currentZonedChronologyDate(String chronology, String zone)
      Obtains the current date using the specified chronology and time zone.
      Parameters:
      chronology - the chronology name
      zone - the zone ID
      Returns:
      the current NaftahDate
    • currentOffsetChronologyDate

      public static NaftahDate currentOffsetChronologyDate(String chronology, String offset)
      Obtains the current date using the specified chronology and offset.
      Parameters:
      chronology - the chronology name
      offset - the offset (e.g. +04:00)
      Returns:
      the current NaftahDate
    • createDate

      public static NaftahDate createDate(Number day, Object month, Number year)
      Creates an NaftahDate instance from day, month, and year.

      The month parameter may be either:

      • a String representing an Arabic month name
      • a Number representing a numeric month value (1–12)
      Parameters:
      day - the day of month (1–31)
      month - the month value, either an Arabic month name (String) or a numeric month (Number), * not null
      year - the year value
      Returns:
      a new NaftahDate instance
      Throws:
      IllegalArgumentException - if month is neither a String nor a Number
    • createDate

      public static NaftahDate createDate(String chronology, Number day, Object month, Number year)
      Creates an NaftahDate instance from a specific chronology, day, month, and year.

      The month parameter may be either:

      • a String representing an Arabic month name
      • a Number representing a numeric month value (1–12)
      Parameters:
      chronology - the chronology name (e.g., "Hijri", "Gregorian")
      day - the day of month (1–31)
      month - the month value, either an Arabic month name (String) or a numeric month (Number), not null
      year - the year value
      Returns:
      a new NaftahDate instance with the specified chronology
      Throws:
      IllegalArgumentException - if month is neither a String nor a Number
    • currentDateTime

      public static NaftahDateTime currentDateTime()
      Obtains the current date-time using the system default settings.
      Returns:
      the current NaftahDateTime
    • currentChronologyDateTime

      public static NaftahDateTime currentChronologyDateTime(String chronology)
      Obtains the current date-time using a specific chronology.
      Parameters:
      chronology - the chronology name
      Returns:
      the current NaftahDateTime
    • currentZonedDateTime

      public static NaftahDateTime currentZonedDateTime(String zone)
      Obtains the current date-time using the specified time zone.
      Parameters:
      zone - the zone ID
      Returns:
      the current NaftahDateTime
    • currentOffsetDateTime

      public static NaftahDateTime currentOffsetDateTime(String offset)
      Obtains the current date-time using a fixed offset.
      Parameters:
      offset - the offset (e.g. +04:00)
      Returns:
      the current NaftahDateTime
    • currentZonedChronologyDateTime

      public static NaftahDateTime currentZonedChronologyDateTime(String chronology, String zone)
      Obtains the current date-time using the specified chronology and time zone.
      Parameters:
      chronology - the chronology name
      zone - the zone ID
      Returns:
      the current NaftahDateTime
    • currentOffsetChronologyDateTime

      public static NaftahDateTime currentOffsetChronologyDateTime(String chronology, String offset)
      Obtains the current date-time using the specified chronology and offset.
      Parameters:
      chronology - the chronology name
      offset - the offset (e.g. +04:00)
      Returns:
      the current NaftahDateTime
    • createDateTime

      public static NaftahDateTime createDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute)
      Creates an NaftahDateTime instance from year, month, day, hour, and minute.

      The month parameter may be either:

      • a String representing an Arabic month name
      • a Number representing a numeric month value (1–12)

      Seconds and nanoseconds default to 0.

      Parameters:
      year - the year value
      month - the month value, either an Arabic month name (String) or a numeric month (Number)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      Returns:
      a new NaftahDateTime instance
      Throws:
      IllegalArgumentException - if month is neither a String nor a Number
    • createZonedDateTime

      public static NaftahDateTime createZonedDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute, String zone)
      Creates an NaftahDateTime instance from year, month, day, hour, and minute using a specific time zone.

      The month parameter may be either:

      • a String representing an Arabic month name
      • a Number representing a numeric month value (1–12)

      Seconds and nanoseconds default to 0.

      ram year the year value

      Parameters:
      month - the month value, either an Arabic month name (String) or a numeric month (Number)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      zone - the time zone ID (e.g. "Asia/Riyadh")
      Returns:
      a new NaftahDateTime instance with the specified time zone
      Throws:
      IllegalArgumentException - if month is neither a String nor a Number
    • createOffsetDateTime

      public static NaftahDateTime createOffsetDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute, String offset)
      Creates an NaftahDateTime instance from year, month, day, hour, and minute using a fixed time offset.

      The month parameter may be either:

      • a String representing an Arabic month name
      • a Number representing a numeric month value (1–12)

      Seconds and nanoseconds default to 0.

      Parameters:
      year - the year value
      month - the month value, either an Arabic month name (String) or a numeric month (Number)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      offset - the time offset (e.g. "+03:00")
      Returns:
      a new NaftahDateTime instance with the specified offset
      Throws:
      IllegalArgumentException - if month is neither a String nor a Number
    • createDateTime

      public static NaftahDateTime createDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second)
      Creates an NaftahDateTime instance from year, month, day, hour, minute, and second.

      The month parameter may be either:

      • a String representing an Arabic month name
      • a Number representing a numeric month value (1–12)

      Nanoseconds default to 0.

      Parameters:
      year - the year value
      month - the month value, either an Arabic month name (String) or a numeric month (Number)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      Returns:
      a new NaftahDateTime instance
      Throws:
      IllegalArgumentException - if month is neither a String nor a Number
    • createZonedDateTime

      public static NaftahDateTime createZonedDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, String zone)
      Creates an NaftahDateTime instance from year, month, day, hour, minute, and second using a specific time zone.

      The month parameter may be either:

      • a String representing an Arabic month name
      • a Number representing a numeric month value (1–12)

      Nanoseconds default to 0.

      Parameters:
      year - the year value
      month - the month value, either an Arabic month name (String) or a numeric month (Number)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      zone - the time zone ID (e.g. "Asia/Riyadh")
      Returns:
      a new NaftahDateTime instance with the specified time zone
      Throws:
      IllegalArgumentException - if month is neither a String nor a Number
    • createOffsetDateTime

      public static NaftahDateTime createOffsetDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, String offset)
      Creates an NaftahDateTime instance from year, month, day, hour, minute, and second using a fixed time offset.

      The month parameter may be either:

      • a String representing an Arabic month name
      • a Number representing a numeric month value (1–12)

      Nanoseconds default to 0.

      Parameters:
      year - the year value
      month - the month value, either an Arabic month name (String) or a numeric month (Number)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      offset - the time offset (e.g. "+04:00")
      Returns:
      a new NaftahDateTime instance with the specified offset
      Throws:
      IllegalArgumentException - if month is neither a String nor a Number
    • createDateTime

      public static NaftahDateTime createDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, Number nanoOfSecond)
      Creates an NaftahDateTime instance from year, month, day, hour, minute, second, and nanosecond.

      The month parameter may be either:

      • a String representing an Arabic month name
      • a Number representing a numeric month value (1–12)
      Parameters:
      year - the year value
      month - the month value, either an Arabic month name (String) or a numeric month (Number)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      nanoOfSecond - the nanosecond-of-second (0–999,999,999)
      Returns:
      a new NaftahDateTime instance
      Throws:
      IllegalArgumentException - if month is neither a String nor a Number
    • createZonedDateTime

      public static NaftahDateTime createZonedDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, Number nanoOfSecond, String zone)
      Creates an NaftahDateTime instance from year, month, day, hour, minute, second, and nanosecond using a specific time zone.

      The month parameter may be either:

      • a String representing an Arabic month name
      • a Number representing a numeric month value (1–12)
      Parameters:
      year - the year value
      month - the month value, either an Arabic month name (String) or a numeric month (Number)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      nanoOfSecond - the nanosecond-of-second (0–999,999,999)
      zone - the time zone ID (e.g. "Asia/Riyadh")
      Returns:
      a new NaftahDateTime instance with the specified time zone
      Throws:
      IllegalArgumentException - if month is neither a String nor a Number
    • createOffsetDateTime

      public static NaftahDateTime createOffsetDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, Number nanoOfSecond, String offset)
      Creates an NaftahDateTime instance from year, month, day, hour, minute, second, and nanosecond using a fixed offset.

      The month parameter may be either:

      • a String representing an Arabic month name
      • a Number representing a numeric month value (1–12)
      Parameters:
      year - the year value
      month - the month value, either an Arabic month name (String) or a numeric month (Number)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      nanoOfSecond - the nanosecond-of-second (0–999,999,999)
      offset - the fixed offset (e.g., "+04:00")
      Returns:
      a new NaftahDateTime instance with the specified offset
      Throws:
      IllegalArgumentException - if month is neither a String nor a Number
    • createChronologyDateTime

      public static NaftahDateTime createChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute)
      Creates an NaftahDateTime instance from year, month, day, hour, and minute using a specific chronology.

      The month parameter may be either:

      • a String representing an Arabic month name
      • a Number representing a numeric month value (1–12)
      Parameters:
      chronology - the chronology name (e.g., "Hijri", "Gregorian")
      year - the year value
      month - the month value, either an Arabic month name (String) or a numeric month * (Number)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      Returns:
      a new NaftahDateTime instance with the specified chronology
      Throws:
      IllegalArgumentException - if month is neither a String nor a Number
    • createZonedChronologyDateTime

      public static NaftahDateTime createZonedChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute, String zone)
      Creates an NaftahDateTime instance from year, month, day, hour, and minute using a specific chronology and a time zone.

      The month parameter may be either:

      • a String representing an Arabic month name
      • a Number representing a numeric month value (1–12)
      Parameters:
      chronology - the chronology name (e.g., "Hijri", "Gregorian")
      year - the year value
      month - the month value, either an Arabic month name (String) or a numeric month * (Number)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      zone - the time zone ID (e.g., "Asia/Riyadh")
      Returns:
      a new NaftahDateTime instance with the specified chronology and zone
      Throws:
      IllegalArgumentException - if month is neither a String nor a Number
    • createOffsetChronologyDateTime

      public static NaftahDateTime createOffsetChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute, String offset)
      Creates an NaftahDateTime instance from year, month, day, hour, and minute using a specific chronology and a fixed offset.

      The month parameter may be either:

      • a String representing an Arabic month name
      • a Number representing a numeric month value (1–12)
      Parameters:
      chronology - the chronology name (e.g., "Hijri", "Gregorian")
      year - the year value
      month - the month value, either an Arabic month name (String) or a numeric month * (Number)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      offset - the fixed offset (e.g., "+04:00")
      Returns:
      a new NaftahDateTime instance with the specified chronology and offset
      Throws:
      IllegalArgumentException - if month is neither a String nor a Number
    • createChronologyDateTime

      public static NaftahDateTime createChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second)
      Creates an NaftahDateTime instance from year, month, day, hour, minute, and second using a specific chronology.

      The month parameter may be either:

      • a String representing an Arabic month name
      • a Number representing a numeric month value (1–12)
      Parameters:
      chronology - the chronology name (e.g., "Hijri", "Gregorian")
      year - the year value
      month - the month value, either an Arabic month name (String) or a numeric month * (Number)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      Returns:
      a new NaftahDateTime instance with the specified chronology
      Throws:
      IllegalArgumentException - if month is neither a String nor a Number
    • createZonedChronologyDateTime

      public static NaftahDateTime createZonedChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, String zone)
      Creates an NaftahDateTime instance from year, month, day, hour, minute, and second using a specific chronology and time zone.

      The month parameter may be either:

      • a String representing an Arabic month name
      • a Number representing a numeric month value (1–12)
      Parameters:
      chronology - the chronology name (e.g., "Hijri", "Gregorian")
      year - the year value
      month - the month value, either an Arabic month name (String) or a numeric month * (Number)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      zone - the time zone ID (e.g., "Asia/Riyadh")
      Returns:
      a new NaftahDateTime instance with the specified chronology and time zone
      Throws:
      IllegalArgumentException - if month is neither a String nor a Number
    • createOffsetChronologyDateTime

      public static NaftahDateTime createOffsetChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, String offset)
      Creates an NaftahDateTime instance from year, month, day, hour, minute, and second using a specific chronology and fixed offset.

      The month parameter may be either:

      • a String representing an Arabic month name
      • a Number representing a numeric month value (1–12)
      Parameters:
      chronology - the chronology name (e.g., "Hijri", "Gregorian")
      year - the year value
      month - the month value, either an Arabic month name (String) or a numeric month * (Number)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      offset - the fixed offset (e.g., "+04:00")
      Returns:
      a new NaftahDateTime instance with the specified chronology and offset
      Throws:
      IllegalArgumentException - if month is neither a String nor a Number
    • createChronologyDateTime

      public static NaftahDateTime createChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, Number nanoOfSecond)
      Creates an NaftahDateTime instance from year, month, day, hour, minute, second, and nanosecond using a specific chronology.

      The month parameter may be either:

      • a String representing an Arabic month name
      • a Number representing a numeric month value (1–12)
      Parameters:
      chronology - the chronology name (e.g., "Hijri", "Gregorian")
      year - the year value
      month - the month value, either an Arabic month name (String) or a numeric month * (Number)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      nanoOfSecond - the nanosecond-of-second (0–999,999,999)
      Returns:
      a new NaftahDateTime instance with the specified chronology and nanoseconds
      Throws:
      IllegalArgumentException - if month is neither a String nor a Number
    • createZonedChronologyDateTime

      public static NaftahDateTime createZonedChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, Number nanoOfSecond, String zone)
      Creates an NaftahDateTime instance from year, month, day, hour, minute, second, and nanosecond using a specific chronology and time zone.

      The month parameter may be either:

      • a String representing an Arabic month name
      • a Number representing a numeric month value (1–12)
      Parameters:
      chronology - the chronology name (e.g., "Hijri", "Gregorian")
      year - the year value
      month - the month value, either an Arabic month name (String) or a numeric month * (Number)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      nanoOfSecond - the nanosecond-of-second (0–999,999,999)
      zone - the time zone ID (e.g., "Asia/Riyadh")
      Returns:
      a new NaftahDateTime instance with the specified chronology and zone
      Throws:
      IllegalArgumentException - if month is neither a String nor a Number
    • createOffsetChronologyDateTime

      public static NaftahDateTime createOffsetChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, Number nanoOfSecond, String offset)
      Creates an NaftahDateTime instance from year, month, day, hour, minute, second, and nanosecond using a specific chronology and fixed offset.

      The month parameter may be either:

      • a String representing an Arabic month name
      • a Number representing a numeric month value (1–12)
      Parameters:
      chronology - the chronology name (e.g., "Hijri", "Gregorian")
      year - the year value
      month - the month value, either an Arabic month name (String) or a numeric month (Number)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      nanoOfSecond - the nanosecond-of-second (0–999,999,999)
      offset - the offset (e.g., "+04:00")
      Returns:
      a new NaftahDateTime instance with the specified chronology and offset
      Throws:
      IllegalArgumentException - if month is neither a String nor a Number
    • toEpochDay

      public static long toEpochDay(DateSupport dateSupport)
      Converts the given DateSupport instance to the epoch day.

      The epoch day is the count of days since 1970-01-01 (ISO).

      Parameters:
      dateSupport - the date or date-time object to convert
      Returns:
      the number of days since the epoch (1970-01-01)
    • getYear

      public static int getYear(DateSupport dateSupport)
      Retrieves the year from a given DateSupport instance.
      Parameters:
      dateSupport - the date or date-time object
      Returns:
      the year value
    • getMonthValue

      public static int getMonthValue(DateSupport dateSupport)
      Gets the month from a temporal point.
      Parameters:
      dateSupport - the temporal point
      Returns:
      the month (1-12)
    • getMonth

      public static String getMonth(DateSupport dateSupport)
      Retrieves the month from a given DateSupport instance.
      Parameters:
      dateSupport - the date or date-time object
      Returns:
      the month as a String, which could be an Arabic month name
    • getDayOfMonth

      public static int getDayOfMonth(DateSupport dateSupport)
      Gets the day of the month from a temporal point.
      Parameters:
      dateSupport - the temporal point
      Returns:
      the day of the month
    • getDayOfYear

      public static int getDayOfYear(DateSupport dateSupport)
      Retrieves the day of the year from a given DateSupport instance.
      Parameters:
      dateSupport - the date or date-time object
      Returns:
      the day of the year (1–365/366)
    • getDayOfWeek

      public static String getDayOfWeek(DateSupport dateSupport)
      Retrieves the day of the week from a given DateSupport instance.
      Parameters:
      dateSupport - the date or date-time object
      Returns:
      the day of the week as a String (e.g., "Monday", "Tuesday")
    • isLeapYear

      public static boolean isLeapYear(DateSupport dateSupport)
      Checks whether the year of the given DateSupport instance is a leap year.
      Parameters:
      dateSupport - the date or date-time object
      Returns:
      true if the year is a leap year, false otherwise
    • lengthOfMonth

      public static int lengthOfMonth(DateSupport dateSupport)
      Returns the number of days in the month of the given DateSupport instance.
      Parameters:
      dateSupport - the date or date-time object
      Returns:
      the length of the month in days
    • lengthOfYear

      public static int lengthOfYear(DateSupport dateSupport)
      Returns the number of days in the year of the given DateSupport instance.
      Parameters:
      dateSupport - the date or date-time object
      Returns:
      the length of the year in days
    • plusYears

      public static NaftahTemporalPoint plusYears(DateSupport dateSupport, Number yearsToAdd)
      Adds a specified number of years to the given DateSupport instance.
      Parameters:
      dateSupport - the date or date-time object
      yearsToAdd - the number of years to add (can be negative)
      Returns:
      a new NaftahTemporalPoint representing the resulting date-time
    • plusMonths

      public static NaftahTemporalPoint plusMonths(DateSupport dateSupport, Number monthsToAdd)
      Adds a specified number of months to the given DateSupport instance.
      Parameters:
      dateSupport - the date or date-time object
      monthsToAdd - the number of months to add (can be negative)
      Returns:
      a new NaftahTemporalPoint representing the resulting date-time
    • plusWeeks

      public static NaftahTemporalPoint plusWeeks(DateSupport dateSupport, Number weeksToAdd)
      Adds a specified number of weeks to the given DateSupport instance.
      Parameters:
      dateSupport - the date or date-time object
      weeksToAdd - the number of weeks to add (can be negative)
      Returns:
      a new NaftahTemporalPoint representing the resulting date-time
    • plusDays

      public static NaftahTemporalPoint plusDays(DateSupport dateSupport, Number daysToAdd)
      Adds a specified number of days to the given DateSupport instance.
      Parameters:
      dateSupport - the date or date-time object
      daysToAdd - the number of days to add (can be negative)
      Returns:
      a new NaftahTemporalPoint representing the resulting date-time
    • minusYears

      public static NaftahTemporalPoint minusYears(DateSupport dateSupport, Number yearsToSubtract)
      Subtracts a specified number of years from the given DateSupport instance.
      Parameters:
      dateSupport - the date or date-time object
      yearsToSubtract - the number of years to subtract (can be negative)
      Returns:
      a new NaftahTemporalPoint representing the resulting date-time
    • minusMonths

      public static NaftahTemporalPoint minusMonths(DateSupport dateSupport, Number monthsToSubtract)
      Subtracts a specified number of months from the given DateSupport instance.
      Parameters:
      dateSupport - the date or date-time object
      monthsToSubtract - the number of months to subtract (can be negative)
      Returns:
      a new NaftahTemporalPoint representing the resulting date-time
    • minusWeeks

      public static NaftahTemporalPoint minusWeeks(DateSupport dateSupport, Number weeksToSubtract)
      Subtracts a specified number of weeks from the given DateSupport instance.
      Parameters:
      dateSupport - the date or date-time object
      weeksToSubtract - the number of weeks to subtract (can be negative)
      Returns:
      a new NaftahTemporalPoint representing the resulting date-time
    • minusDays

      public static NaftahTemporalPoint minusDays(DateSupport dateSupport, Number daysToSubtract)
      Subtracts a specified number of days from the given DateSupport instance.
      Parameters:
      dateSupport - the date or date-time object
      daysToSubtract - the number of days to subtract (can be negative)
      Returns:
      a new NaftahTemporalPoint representing the resulting date-time
    • getHour

      public static int getHour(TimeSupport timeSupport)
      Gets the hour of the day from a temporal point.
      Parameters:
      timeSupport - the temporal point
      Returns:
      the hour (0-23)
    • getMinute

      public static int getMinute(TimeSupport timeSupport)
      Gets the minute of the hour from a temporal point.
      Parameters:
      timeSupport - the temporal point
      Returns:
      the minute
    • getSecond

      public static int getSecond(TimeSupport timeSupport)
      Gets the second of the minute from a temporal point.
      Parameters:
      timeSupport - the temporal point
      Returns:
      the second
    • getMilli

      public static int getMilli(TimeSupport timeSupport)
      Gets the millisecond of the second from a temporal point.
      Parameters:
      timeSupport - the temporal point
      Returns:
      the millisecond
    • getNano

      public static int getNano(TimeSupport timeSupport)
      Gets the nanosecond of the second from a temporal point.
      Parameters:
      timeSupport - the temporal point
      Returns:
      the nanosecond
    • plusHours

      public static NaftahTemporalPoint plusHours(TimeSupport timeSupport, Number hoursToAdd)
      Adds a specified number of hours to the given TimeSupport instance.
      Parameters:
      timeSupport - the time object
      hoursToAdd - the number of hours to add (can be negative)
      Returns:
      a new NaftahTemporalPoint representing the resulting time
    • plusMinutes

      public static NaftahTemporalPoint plusMinutes(TimeSupport timeSupport, Number minutesToAdd)
      Adds a specified number of minutes to the given TimeSupport instance.
      Parameters:
      timeSupport - the time object
      minutesToAdd - the number of minutes to add (can be negative)
      Returns:
      a new NaftahTemporalPoint representing the resulting time
    • plusSeconds

      public static NaftahTemporalPoint plusSeconds(TimeSupport timeSupport, Number secondsToAdd)
      Adds a specified number of seconds to the given TimeSupport instance.
      Parameters:
      timeSupport - the time object
      secondsToAdd - the number of seconds to add (can be negative)
      Returns:
      a new NaftahTemporalPoint representing the resulting time
    • plusNanos

      public static NaftahTemporalPoint plusNanos(TimeSupport timeSupport, Number nanosToAdd)
      Adds a specified number of nanoseconds to the given TimeSupport instance.
      Parameters:
      timeSupport - the time object
      nanosToAdd - the number of nanoseconds to add (can be negative)
      Returns:
      a new NaftahTemporalPoint representing the resulting time
    • minusHours

      public static NaftahTemporalPoint minusHours(TimeSupport timeSupport, Number hoursToSubtract)
      Subtracts a specified number of hours from the given TimeSupport instance.
      Parameters:
      timeSupport - the time object
      hoursToSubtract - the number of hours to subtract (can be negative)
      Returns:
      a new NaftahTemporalPoint representing the resulting time
    • minusMinutes

      public static NaftahTemporalPoint minusMinutes(TimeSupport timeSupport, Number minutesToSubtract)
      Subtracts a specified number of minutes from the given TimeSupport instance.
      Parameters:
      timeSupport - the time object
      minutesToSubtract - the number of minutes to subtract (can be negative)
      Returns:
      a new NaftahTemporalPoint representing the resulting time
    • minusSeconds

      public static NaftahTemporalPoint minusSeconds(TimeSupport timeSupport, Number secondsToSubtract)
      Subtracts a specified number of seconds from the given TimeSupport instance.
      Parameters:
      timeSupport - the time object
      secondsToSubtract - the number of seconds to subtract (can be negative)
      Returns:
      a new NaftahTemporalPoint representing the resulting time
    • minusNanos

      public static NaftahTemporalPoint minusNanos(TimeSupport timeSupport, Number nanosToSubtract)
      Subtracts a specified number of nanoseconds from the given TimeSupport instance.
      Parameters:
      timeSupport - the time object
      nanosToSubtract - the number of nanoseconds to subtract (can be negative)
      Returns:
      a new NaftahTemporalPoint representing the resulting time
    • createZeroDuration

      public static NaftahDuration createZeroDuration()
      Creates a zero duration.
      Returns:
      a NaftahDuration representing zero duration
    • createDurationFromDays

      public static NaftahDuration createDurationFromDays(Number days)
      Creates a duration from the specified number of days.
      Parameters:
      days - the number of days
      Returns:
      a NaftahDuration representing the specified days
    • createDurationFromHours

      public static NaftahDuration createDurationFromHours(Number hours)
      Creates a duration from the specified number of hours.
      Parameters:
      hours - the number of hours
      Returns:
      a NaftahDuration representing the specified hours
    • createDurationFromMinutes

      public static NaftahDuration createDurationFromMinutes(Number minutes)
      Creates a duration from the specified number of minutes.
      Parameters:
      minutes - the number of minutes
      Returns:
      a NaftahDuration representing the specified minutes
    • createDurationFromSeconds

      public static NaftahDuration createDurationFromSeconds(Number seconds)
      Creates a duration from the specified number of seconds.
      Parameters:
      seconds - the number of seconds
      Returns:
      a NaftahDuration representing the specified seconds
    • createDurationFromSecondsAndNano

      public static NaftahDuration createDurationFromSecondsAndNano(Number seconds, Number nanoAdjustment)
      Creates a duration from seconds with a nanosecond adjustment.
      Parameters:
      seconds - the number of seconds
      nanoAdjustment - the nanosecond adjustment
      Returns:
      a NaftahDuration representing the specified seconds and nano adjustment
    • createDurationFromMillis

      public static NaftahDuration createDurationFromMillis(Number millis)
      Creates a duration from the specified number of milliseconds.
      Parameters:
      millis - the number of milliseconds
      Returns:
      a NaftahDuration representing the specified milliseconds
    • createDurationFromNanos

      public static NaftahDuration createDurationFromNanos(Number nanos)
      Creates a duration from the specified number of nanoseconds.
      Parameters:
      nanos - the number of nanoseconds
      Returns:
      a NaftahDuration representing the specified nanoseconds
    • createZeroPeriod

      public static NaftahPeriod createZeroPeriod()
      Creates a zero period.
      Returns:
      a NaftahPeriod representing zero period
    • createPeriodFromYears

      public static NaftahPeriod createPeriodFromYears(Number years)
      Creates a period from the specified number of years.
      Parameters:
      years - the number of years
      Returns:
      a NaftahPeriod representing the specified years
    • createPeriodFromMonths

      public static NaftahPeriod createPeriodFromMonths(Number months)
      Creates a period from the specified number of months.
      Parameters:
      months - the number of months
      Returns:
      a NaftahPeriod representing the specified months
    • createPeriodFromWeeks

      public static NaftahPeriod createPeriodFromWeeks(Number weeks)
      Creates a period from the specified number of weeks.
      Parameters:
      weeks - the number of weeks
      Returns:
      a NaftahPeriod representing the specified weeks
    • createPeriodFromDays

      public static NaftahPeriod createPeriodFromDays(Number days)
      Creates a period from the specified number of days.
      Parameters:
      days - the number of days
      Returns:
      a NaftahPeriod representing the specified days
    • createZeroPeriodWithDuration

      public static NaftahPeriodWithDuration createZeroPeriodWithDuration()
      Creates a period with duration of zero (both period and duration are zero).
      Returns:
      a NaftahPeriodWithDuration representing zero period and zero duration
    • createPeriodWithDurationFromYears

      public static NaftahPeriodWithDuration createPeriodWithDurationFromYears(Number years)
      Creates a period with duration from the specified number of years.
      Parameters:
      years - the number of years
      Returns:
      a NaftahPeriodWithDuration with specified years and zero duration
    • createPeriodWithDurationFromMonths

      public static NaftahPeriodWithDuration createPeriodWithDurationFromMonths(Number months)
      Creates a period with duration from the specified number of months.
      Parameters:
      months - the number of months
      Returns:
      a NaftahPeriodWithDuration with specified months and zero duration
    • createPeriodWithDurationFromWeeks

      public static NaftahPeriodWithDuration createPeriodWithDurationFromWeeks(Number weeks)
      Creates a period with duration from the specified number of weeks.
      Parameters:
      weeks - the number of weeks
      Returns:
      a NaftahPeriodWithDuration with specified weeks and zero duration
    • createPeriodWithDurationFromDays

      public static NaftahPeriodWithDuration createPeriodWithDurationFromDays(Number days)
      Creates a period with duration from the specified number of days.
      Parameters:
      days - the number of days
      Returns:
      a NaftahPeriodWithDuration with specified days and zero duration
    • createPeriodWithDurationFromHours

      public static NaftahPeriodWithDuration createPeriodWithDurationFromHours(Number hours)
      Creates a period with duration from the specified number of hours.
      Parameters:
      hours - the number of hours
      Returns:
      a NaftahPeriodWithDuration with zero period and specified hours as duration
    • createPeriodWithDurationFromMinutes

      public static NaftahPeriodWithDuration createPeriodWithDurationFromMinutes(Number minutes)
      Creates a period with duration from the specified number of minutes.
      Parameters:
      minutes - the number of minutes
      Returns:
      a NaftahPeriodWithDuration with zero period and specified minutes as duration
    • createPeriodWithDurationFromSeconds

      public static NaftahPeriodWithDuration createPeriodWithDurationFromSeconds(Number seconds)
      Creates a period with duration from the specified number of seconds.
      Parameters:
      seconds - the number of seconds
      Returns:
      a NaftahPeriodWithDuration with zero period and specified seconds as duration
    • createPeriodWithDurationFromSecondsAndNano

      public static NaftahPeriodWithDuration createPeriodWithDurationFromSecondsAndNano(Number seconds, Number nanoAdjustment)
      Creates a period with duration from the specified seconds and nanosecond adjustment.
      Parameters:
      seconds - the number of seconds
      nanoAdjustment - the nanosecond adjustment
      Returns:
      a NaftahPeriodWithDuration with zero period and adjusted duration
    • createPeriodWithDurationFromMillis

      public static NaftahPeriodWithDuration createPeriodWithDurationFromMillis(Number millis)
      Creates a period with duration from the specified number of milliseconds.
      Parameters:
      millis - the number of milliseconds
      Returns:
      a NaftahPeriodWithDuration with zero period and specified milliseconds as duration
    • createPeriodWithDurationFromNanos

      public static NaftahPeriodWithDuration createPeriodWithDurationFromNanos(Number nanos)
      Creates a period with duration from the specified number of nanoseconds.
      Parameters:
      nanos - the number of nanoseconds
      Returns:
      a NaftahPeriodWithDuration with zero period and specified nanoseconds as duration
    • plusYears

      public static NaftahPeriod plusYears(NaftahPeriod p, Number years)
      Adds a number of years to the given period.
      Parameters:
      p - the original period
      years - the number of years to add
      Returns:
      a NaftahPeriod with years added
    • plusMonths

      public static NaftahPeriod plusMonths(NaftahPeriod p, Number months)
      Adds a number of months to the given period.
      Parameters:
      p - the original period
      months - the number of months to add
      Returns:
      a NaftahPeriod with months added
    • plusDays

      public static NaftahPeriod plusDays(NaftahPeriod p, Number days)
      Adds a number of days to the given period.
      Parameters:
      p - the original period
      days - the number of days to add
      Returns:
      a NaftahPeriod with days added
    • minusYears

      public static NaftahPeriod minusYears(NaftahPeriod p, Number years)
      Subtracts a number of years from the given period.
      Parameters:
      p - the original period
      years - the number of years to subtract
      Returns:
      a NaftahPeriod with years subtracted
    • minusMonths

      public static NaftahPeriod minusMonths(NaftahPeriod p, Number months)
      Subtracts a number of months from the given period.
      Parameters:
      p - the original period
      months - the number of months to subtract
      Returns:
      a NaftahPeriod with months subtracted
    • minusDays

      public static NaftahPeriod minusDays(NaftahPeriod p, Number days)
      Subtracts a number of days from the given period.
      Parameters:
      p - the original period
      days - the number of days to subtract
      Returns:
      a NaftahPeriod with days subtracted
    • plusDays

      public static NaftahDuration plusDays(NaftahDuration d, Number days)
      Adds a number of days to a given duration.
      Parameters:
      d - the original duration
      days - the number of days to add
      Returns:
      a NaftahDuration with days added
    • plusHours

      public static NaftahDuration plusHours(NaftahDuration d, Number hours)
      Adds a number of hours to a given duration.
      Parameters:
      d - the original duration
      hours - the number of hours to add
      Returns:
      a NaftahDuration with hours added
    • plusMinutes

      public static NaftahDuration plusMinutes(NaftahDuration d, Number minutes)
      Adds a number of minutes to a given duration.
      Parameters:
      d - the original duration
      minutes - the number of minutes to add
      Returns:
      a NaftahDuration with minutes added
    • plusSeconds

      public static NaftahDuration plusSeconds(NaftahDuration d, Number seconds)
      Adds seconds to a duration.
      Parameters:
      d - the duration
      seconds - the number of seconds to add
      Returns:
      a new duration with the added seconds
    • plusMillis

      public static NaftahDuration plusMillis(NaftahDuration d, Number millis)
      Adds milliseconds to a duration.
      Parameters:
      d - the duration
      millis - the number of milliseconds to add
      Returns:
      a new duration with the added milliseconds
    • plusNanos

      public static NaftahDuration plusNanos(NaftahDuration d, Number nanos)
      Adds nanoseconds to a duration.
      Parameters:
      d - the duration
      nanos - the number of nanoseconds to add
      Returns:
      a new duration with the added nanoseconds
    • minusDays

      public static NaftahDuration minusDays(NaftahDuration d, Number days)
      Subtracts days from a duration.
      Parameters:
      d - the duration
      days - the number of days to subtract
      Returns:
      a new duration with the days subtracted
    • minusHours

      public static NaftahDuration minusHours(NaftahDuration d, Number hours)
      Subtracts hours from a duration.
      Parameters:
      d - the duration
      hours - the number of hours to subtract
      Returns:
      a new duration with the hours subtracted
    • minusMinutes

      public static NaftahDuration minusMinutes(NaftahDuration d, Number minutes)
      Subtracts minutes from a duration.
      Parameters:
      d - the duration
      minutes - the number of minutes to subtract
      Returns:
      a new duration with the minutes subtracted
    • minusSeconds

      public static NaftahDuration minusSeconds(NaftahDuration d, Number seconds)
      Subtracts seconds from a duration.
      Parameters:
      d - the duration
      seconds - the number of seconds to subtract
      Returns:
      a new duration with the seconds subtracted
    • minusMillis

      public static NaftahDuration minusMillis(NaftahDuration d, Number millis)
      Subtracts milliseconds from a duration.
      Parameters:
      d - the duration
      millis - the number of milliseconds to subtract
      Returns:
      a new duration with the milliseconds subtracted
    • minusNanos

      public static NaftahDuration minusNanos(NaftahDuration d, Number nanos)
      Subtracts nanoseconds from a duration.
      Parameters:
      d - the duration
      nanos - the number of nanoseconds to subtract
      Returns:
      a new duration with the nanoseconds subtracted
    • plusYears

      public static NaftahPeriodWithDuration plusYears(NaftahPeriodWithDuration pd, Number years)
      Adds years to a period with duration.
      Parameters:
      pd - the period with duration
      years - the number of years to add
      Returns:
      a new period with duration with the added years
    • plusMonths

      public static NaftahPeriodWithDuration plusMonths(NaftahPeriodWithDuration pd, Number months)
      Adds months to a period with duration.
      Parameters:
      pd - the period with duration
      months - the number of months to add
      Returns:
      a new period with duration with the added months
    • plusDays

      public static NaftahPeriodWithDuration plusDays(NaftahPeriodWithDuration pd, Number days)
      Adds days to a period with duration.
      Parameters:
      pd - the period with duration
      days - the number of days to add
      Returns:
      a new period with duration with the added days
    • plusHours

      public static NaftahPeriodWithDuration plusHours(NaftahPeriodWithDuration pd, Number hours)
      Adds hours to a period with duration.
      Parameters:
      pd - the period with duration
      hours - the number of hours to add
      Returns:
      a new period with duration with the added hours
    • plusMinutes

      public static NaftahPeriodWithDuration plusMinutes(NaftahPeriodWithDuration pd, Number minutes)
      Adds minutes to a period with duration.
      Parameters:
      pd - the period with duration
      minutes - the number of minutes to add
      Returns:
      a new period with duration with the added minutes
    • plusSeconds

      public static NaftahPeriodWithDuration plusSeconds(NaftahPeriodWithDuration pd, Number seconds)
      Adds seconds to a period with duration.
      Parameters:
      pd - the period with duration
      seconds - the number of seconds to add
      Returns:
      a new period with duration with the added seconds
    • plusMillis

      public static NaftahPeriodWithDuration plusMillis(NaftahPeriodWithDuration pd, Number millis)
      Adds milliseconds to a period with duration.
      Parameters:
      pd - the period with duration
      millis - the number of milliseconds to add
      Returns:
      a new period with duration with the added milliseconds
    • plusNanos

      public static NaftahPeriodWithDuration plusNanos(NaftahPeriodWithDuration pd, Number nanos)
      Adds nanoseconds to a period with duration.
      Parameters:
      pd - the period with duration
      nanos - the number of nanoseconds to add
      Returns:
      a new period with duration with the added nanoseconds
    • minusYears

      public static NaftahPeriodWithDuration minusYears(NaftahPeriodWithDuration pd, Number years)
      Subtracts years from a period with duration.
      Parameters:
      pd - the period with duration
      years - the number of years to subtract
      Returns:
      a new period with duration with the years subtracted
    • minusMonths

      public static NaftahPeriodWithDuration minusMonths(NaftahPeriodWithDuration pd, Number months)
      Subtracts months from a period with duration.
      Parameters:
      pd - the period with duration
      months - the number of months to subtract
      Returns:
      a new period with duration with the months subtracted
    • minusDays

      public static NaftahPeriodWithDuration minusDays(NaftahPeriodWithDuration pd, Number days)
      Subtracts days from a period with duration.
      Parameters:
      pd - the period with duration
      days - the number of days to subtract
      Returns:
      a new period with duration with the days subtracted
    • minusHours

      public static NaftahPeriodWithDuration minusHours(NaftahPeriodWithDuration pd, Number hours)
      Subtracts hours from a period with duration.
      Parameters:
      pd - the period with duration
      hours - the number of hours to subtract
      Returns:
      a new period with duration with the hours subtracted
    • minusMinutes

      public static NaftahPeriodWithDuration minusMinutes(NaftahPeriodWithDuration pd, Number minutes)
      Subtracts minutes from a period with duration.
      Parameters:
      pd - the period with duration
      minutes - the number of minutes to subtract
      Returns:
      a new period with duration with the minutes subtracted
    • minusSeconds

      public static NaftahPeriodWithDuration minusSeconds(NaftahPeriodWithDuration pd, Number seconds)
      Subtracts seconds from a period with duration.
      Parameters:
      pd - the period with duration
      seconds - the number of seconds to subtract
      Returns:
      a new period with duration with the seconds subtracted
    • minusMillis

      public static NaftahPeriodWithDuration minusMillis(NaftahPeriodWithDuration pd, Number millis)
      Subtracts milliseconds from a period with duration.
      Parameters:
      pd - the period with duration
      millis - the number of milliseconds to subtract
      Returns:
      a new period with duration with the milliseconds subtracted
    • minusNanos

      public static NaftahPeriodWithDuration minusNanos(NaftahPeriodWithDuration pd, Number nanos)
      Subtracts nanoseconds from a period with duration.
      Parameters:
      pd - the period with duration
      nanos - the number of nanoseconds to subtract
      Returns:
      a new period with duration with the nanoseconds subtracted
    • getYears

      public static int getYears(NaftahPeriod p)
      Gets the number of years in a period.
      Parameters:
      p - the period
      Returns:
      the number of years
    • getMonths

      public static int getMonths(NaftahPeriod p)
      Gets the number of months in a period.
      Parameters:
      p - the period
      Returns:
      the number of months
    • getDays

      public static int getDays(NaftahPeriod p)
      Gets the number of days in a period.
      Parameters:
      p - the period
      Returns:
      the number of days
    • getHours

      public static long getHours(NaftahDuration d)
      Gets the number of hours in a duration.
      Parameters:
      d - the duration
      Returns:
      the number of hours
    • getMinutes

      public static long getMinutes(NaftahDuration d)
      Gets the number of minutes in a duration.
      Parameters:
      d - the duration
      Returns:
      the number of minutes
    • getSeconds

      public static long getSeconds(NaftahDuration d)
      Gets the number of seconds in a duration.
      Parameters:
      d - the duration
      Returns:
      the number of seconds
    • getMillis

      public static long getMillis(NaftahDuration d)
      Gets the number of milliseconds in a duration.
      Parameters:
      d - the duration
      Returns:
      the number of milliseconds
    • getNano

      public static int getNano(NaftahDuration d)
      Gets the number of nanoseconds in a duration.
      Parameters:
      d - the duration
      Returns:
      the number of nanoseconds
    • getYears

      public static int getYears(NaftahPeriodWithDuration p)
      Gets the number of years from a period with duration.
      Parameters:
      p - the period with duration
      Returns:
      the number of years
    • getMonths

      public static int getMonths(NaftahPeriodWithDuration p)
      Gets the number of months from a period with duration.
      Parameters:
      p - the period with duration
      Returns:
      the number of months
    • getDays

      public static int getDays(NaftahPeriodWithDuration p)
      Gets the number of days from a period with duration.
      Parameters:
      p - the period with duration
      Returns:
      the number of days
    • getHours

      public static long getHours(NaftahPeriodWithDuration d)
      Gets the number of hours from a period with duration.
      Parameters:
      d - the period with duration
      Returns:
      the number of hours
    • getMinutes

      public static long getMinutes(NaftahPeriodWithDuration d)
      Gets the number of minutes from a period with duration.
      Parameters:
      d - the period with duration
      Returns:
      the number of minutes
    • getSeconds

      public static long getSeconds(NaftahPeriodWithDuration d)
      Gets the number of seconds from a period with duration.
      Parameters:
      d - the period with duration
      Returns:
      the number of seconds
    • getMillis

      public static long getMillis(NaftahPeriodWithDuration d)
      Gets the number of milliseconds from a period with duration.
      Parameters:
      d - the period with duration
      Returns:
      the number of milliseconds
    • getNano

      public static int getNano(NaftahPeriodWithDuration d)
      Gets the number of nanoseconds from a period with duration.
      Parameters:
      d - the period with duration
      Returns:
      the number of nanoseconds
    • createTemporalAmountBetween

      public static NaftahTemporalAmount createTemporalAmountBetween(NaftahTemporalPoint left, NaftahTemporalPoint right)
      Creates a temporal amount representing the difference between two temporal points.
      Parameters:
      left - the first temporal point
      right - the second temporal point
      Returns:
      the temporal amount between the two points