Class TemporalBuiltinFunctions
All functions are static; this class cannot be instantiated.
- Author:
- Chakib Daii
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePrivate constructor to prevent instantiation. -
Method Summary
Modifier and TypeMethodDescriptionstatic NaftahDateTimecreateChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute) Creates anNaftahDateTimeinstance from year, month, day, hour, and minute using a specific chronology.static NaftahDateTimecreateChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second) Creates anNaftahDateTimeinstance from year, month, day, hour, minute, and second using a specific chronology.static NaftahDateTimecreateChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, Number nanoOfSecond) Creates anNaftahDateTimeinstance from year, month, day, hour, minute, second, and nanosecond using a specific chronology.static NaftahDatecreateDate(Number day, Object month, Number year) Creates anNaftahDateinstance from day, month, and year.static NaftahDatecreateDate(String chronology, Number day, Object month, Number year) Creates anNaftahDateinstance from a specific chronology, day, month, and year.static NaftahDateTimeCreates anNaftahDateTimeinstance from year, month, day, hour, and minute.static NaftahDateTimecreateDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second) Creates anNaftahDateTimeinstance from year, month, day, hour, minute, and second.static NaftahDateTimecreateDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, Number nanoOfSecond) Creates anNaftahDateTimeinstance from year, month, day, hour, minute, second, and nanosecond.static NaftahDurationcreateDurationFromDays(Number days) Creates a duration from the specified number of days.static NaftahDurationcreateDurationFromHours(Number hours) Creates a duration from the specified number of hours.static NaftahDurationcreateDurationFromMillis(Number millis) Creates a duration from the specified number of milliseconds.static NaftahDurationcreateDurationFromMinutes(Number minutes) Creates a duration from the specified number of minutes.static NaftahDurationcreateDurationFromNanos(Number nanos) Creates a duration from the specified number of nanoseconds.static NaftahDurationcreateDurationFromSeconds(Number seconds) Creates a duration from the specified number of seconds.static NaftahDurationcreateDurationFromSecondsAndNano(Number seconds, Number nanoAdjustment) Creates a duration from seconds with a nanosecond adjustment.static NaftahDateTimecreateOffsetChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, Number nanoOfSecond, String offset) Creates anNaftahDateTimeinstance from year, month, day, hour, minute, second, and nanosecond using a specific chronology and fixed offset.static NaftahDateTimecreateOffsetChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, String offset) Creates anNaftahDateTimeinstance from year, month, day, hour, minute, and second using a specific chronology and fixed offset.static NaftahDateTimecreateOffsetChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute, String offset) Creates anNaftahDateTimeinstance from year, month, day, hour, and minute using a specific chronology and a fixed offset.static NaftahDateTimecreateOffsetDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, Number nanoOfSecond, String offset) Creates anNaftahDateTimeinstance from year, month, day, hour, minute, second, and nanosecond using a fixed offset.static NaftahDateTimecreateOffsetDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, String offset) Creates anNaftahDateTimeinstance from year, month, day, hour, minute, and second using a fixed time offset.static NaftahDateTimecreateOffsetDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute, String offset) Creates anNaftahDateTimeinstance from year, month, day, hour, and minute using a fixed time offset.static NaftahTimeCreates anNaftahTimeinstance from hour, minute, second, and nanosecond with a specific offset.static NaftahTimecreateOffsetTime(Number hour, Number minute, Number second, String offset) Creates an offsetNaftahTimeinstance from hour, minute, second, and offset.static NaftahTimecreateOffsetTime(Number hour, Number minute, String offset) Creates an offsetNaftahTimeinstance from hour, minute, and offset.static NaftahTimecreateOffsetTimeOfNanoOfDay(Number nanoOfDay, String offset) Creates anNaftahTimeinstance from the total number of nanoseconds since midnight with a fixed offset.static NaftahTimecreateOffsetTimeOfSecondOfDay(Number secondOfDay, String offset) Creates anNaftahTimeinstance from the total number of seconds since midnight with a specific offset.static NaftahPeriodcreatePeriodFromDays(Number days) Creates a period from the specified number of days.static NaftahPeriodcreatePeriodFromMonths(Number months) Creates a period from the specified number of months.static NaftahPeriodcreatePeriodFromWeeks(Number weeks) Creates a period from the specified number of weeks.static NaftahPeriodcreatePeriodFromYears(Number years) Creates a period from the specified number of years.static NaftahPeriodWithDurationCreates a period with duration from the specified number of days.static NaftahPeriodWithDurationCreates a period with duration from the specified number of hours.static NaftahPeriodWithDurationCreates a period with duration from the specified number of milliseconds.static NaftahPeriodWithDurationCreates a period with duration from the specified number of minutes.static NaftahPeriodWithDurationCreates a period with duration from the specified number of months.static NaftahPeriodWithDurationCreates a period with duration from the specified number of nanoseconds.static NaftahPeriodWithDurationCreates a period with duration from the specified number of seconds.static NaftahPeriodWithDurationcreatePeriodWithDurationFromSecondsAndNano(Number seconds, Number nanoAdjustment) Creates a period with duration from the specified seconds and nanosecond adjustment.static NaftahPeriodWithDurationCreates a period with duration from the specified number of weeks.static NaftahPeriodWithDurationCreates a period with duration from the specified number of years.static NaftahTemporalAmountCreates a temporal amount representing the difference between two temporal points.static NaftahTimecreateTime(Number hour, Number minute) Creates anNaftahTimeinstance from hour and minute.static NaftahTimecreateTime(Number hour, Number minute, Number second) Creates anNaftahTimeinstance from hour, minute, and second.static NaftahTimecreateTime(Number hour, Number minute, Number second, Number nanoOfSecond) Creates anNaftahTimeinstance from hour, minute, second, and nanosecond.static NaftahTimecreateTimeOfNanoOfDay(Number nanoOfDay) Creates anNaftahTimeinstance from the total number of nanoseconds since midnight.static NaftahTimecreateTimeOfSecondOfDay(Number secondOfDay) Creates anNaftahTimeinstance from the total number of seconds since midnight.static NaftahDurationCreates a zero duration.static NaftahPeriodCreates a zero period.static NaftahPeriodWithDurationCreates a period with duration of zero (both period and duration are zero).static NaftahDateTimecreateZonedChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, Number nanoOfSecond, String zone) Creates anNaftahDateTimeinstance from year, month, day, hour, minute, second, and nanosecond using a specific chronology and time zone.static NaftahDateTimecreateZonedChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, String zone) Creates anNaftahDateTimeinstance from year, month, day, hour, minute, and second using a specific chronology and time zone.static NaftahDateTimecreateZonedChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute, String zone) Creates anNaftahDateTimeinstance from year, month, day, hour, and minute using a specific chronology and a time zone.static NaftahDateTimecreateZonedDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, Number nanoOfSecond, String zone) Creates anNaftahDateTimeinstance from year, month, day, hour, minute, second, and nanosecond using a specific time zone.static NaftahDateTimecreateZonedDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, String zone) Creates anNaftahDateTimeinstance from year, month, day, hour, minute, and second using a specific time zone.static NaftahDateTimecreateZonedDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute, String zone) Creates anNaftahDateTimeinstance from year, month, day, hour, and minute using a specific time zone.static NaftahTimeCreates anNaftahTimeinstance from hour, minute, second, and nanosecond with a specific time zone.static NaftahTimecreateZonedTime(Number hour, Number minute, Number second, String zone) Creates a zonedNaftahTimeinstance from hour, minute, second, and zone.static NaftahTimecreateZonedTime(Number hour, Number minute, String zone) Creates a zonedNaftahTimeinstance from hour, minute, and time zone.static NaftahTimecreateZonedTimeOfNanoOfDay(Number nanoOfDay, String zone) Creates anNaftahTimeinstance from the total number of nanoseconds since midnight with a specific time zone.static NaftahTimecreateZonedTimeOfSecondOfDay(Number secondOfDay, String zone) Creates anNaftahTimeinstance from the total number of seconds since midnight with a specific time * zone.static NaftahDatecurrentChronologyDate(String chronology) Obtains the current date using the specified chronology.static NaftahDateTimecurrentChronologyDateTime(String chronology) Obtains the current date-time using a specific chronology.static NaftahDateObtains the current date using the default chronology.static NaftahDateTimeObtains the current date-time using the system default settings.static NaftahDatecurrentOffsetChronologyDate(String chronology, String offset) Obtains the current date using the specified chronology and offset.static NaftahDateTimecurrentOffsetChronologyDateTime(String chronology, String offset) Obtains the current date-time using the specified chronology and offset.static NaftahDatecurrentOffsetDate(String offset) Obtains the current date using a fixed offset.static NaftahDateTimecurrentOffsetDateTime(String offset) Obtains the current date-time using a fixed offset.static NaftahTimecurrentOffsetTime(String offset) Obtains the current time using a fixed offset.static NaftahTimeObtains the current time using the system default time zone.static NaftahDatecurrentZonedChronologyDate(String chronology, String zone) Obtains the current date using the specified chronology and time zone.static NaftahDateTimecurrentZonedChronologyDateTime(String chronology, String zone) Obtains the current date-time using the specified chronology and time zone.static NaftahDatecurrentZonedDate(String zone) Obtains the current date using the specified time zone.static NaftahDateTimecurrentZonedDateTime(String zone) Obtains the current date-time using the specified time zone.static NaftahTimecurrentZonedTime(String zone) Obtains the current time using the specified time zone.static intgetDayOfMonth(DateSupport dateSupport) Gets the day of the month from a temporal point.static StringgetDayOfWeek(DateSupport dateSupport) Retrieves the day of the week from a givenDateSupportinstance.static intgetDayOfYear(DateSupport dateSupport) Retrieves the day of the year from a givenDateSupportinstance.static intGets the number of days in a period.static intGets the number of days from a period with duration.static intgetHour(TimeSupport timeSupport) Gets the hour of the day from a temporal point.static longGets the number of hours in a duration.static longGets the number of hours from a period with duration.static intgetMilli(TimeSupport timeSupport) Gets the millisecond of the second from a temporal point.static longGets the number of milliseconds in a duration.static longGets the number of milliseconds from a period with duration.static intgetMinute(TimeSupport timeSupport) Gets the minute of the hour from a temporal point.static longGets the number of minutes in a duration.static longGets the number of minutes from a period with duration.static StringgetMonth(DateSupport dateSupport) Retrieves the month from a givenDateSupportinstance.static intGets the number of months in a period.static intGets the number of months from a period with duration.static intgetMonthValue(DateSupport dateSupport) Gets the month from a temporal point.static intGets the number of nanoseconds in a duration.static intGets the number of nanoseconds from a period with duration.static intgetNano(TimeSupport timeSupport) Gets the nanosecond of the second from a temporal point.static intgetSecond(TimeSupport timeSupport) Gets the second of the minute from a temporal point.static longGets the number of seconds in a duration.static longGets the number of seconds from a period with duration.static intgetYear(DateSupport dateSupport) Retrieves the year from a givenDateSupportinstance.static intGets the number of years in a period.static intGets the number of years from a period with duration.static booleanisLeapYear(DateSupport dateSupport) Checks whether the year of the givenDateSupportinstance is a leap year.static intlengthOfMonth(DateSupport dateSupport) Returns the number of days in the month of the givenDateSupportinstance.static intlengthOfYear(DateSupport dateSupport) Returns the number of days in the year of the givenDateSupportinstance.static NaftahTemporalPointminusDays(DateSupport dateSupport, Number daysToSubtract) Subtracts a specified number of days from the givenDateSupportinstance.static NaftahDurationminusDays(NaftahDuration d, Number days) Subtracts days from a duration.static NaftahPeriodminusDays(NaftahPeriod p, Number days) Subtracts a number of days from the given period.static NaftahPeriodWithDurationminusDays(NaftahPeriodWithDuration pd, Number days) Subtracts days from a period with duration.static NaftahDurationminusHours(NaftahDuration d, Number hours) Subtracts hours from a duration.static NaftahPeriodWithDurationminusHours(NaftahPeriodWithDuration pd, Number hours) Subtracts hours from a period with duration.static NaftahTemporalPointminusHours(TimeSupport timeSupport, Number hoursToSubtract) Subtracts a specified number of hours from the givenTimeSupportinstance.static NaftahDurationminusMillis(NaftahDuration d, Number millis) Subtracts milliseconds from a duration.static NaftahPeriodWithDurationminusMillis(NaftahPeriodWithDuration pd, Number millis) Subtracts milliseconds from a period with duration.static NaftahDurationminusMinutes(NaftahDuration d, Number minutes) Subtracts minutes from a duration.static NaftahPeriodWithDurationminusMinutes(NaftahPeriodWithDuration pd, Number minutes) Subtracts minutes from a period with duration.static NaftahTemporalPointminusMinutes(TimeSupport timeSupport, Number minutesToSubtract) Subtracts a specified number of minutes from the givenTimeSupportinstance.static NaftahTemporalPointminusMonths(DateSupport dateSupport, Number monthsToSubtract) Subtracts a specified number of months from the givenDateSupportinstance.static NaftahPeriodminusMonths(NaftahPeriod p, Number months) Subtracts a number of months from the given period.static NaftahPeriodWithDurationminusMonths(NaftahPeriodWithDuration pd, Number months) Subtracts months from a period with duration.static NaftahDurationminusNanos(NaftahDuration d, Number nanos) Subtracts nanoseconds from a duration.static NaftahPeriodWithDurationminusNanos(NaftahPeriodWithDuration pd, Number nanos) Subtracts nanoseconds from a period with duration.static NaftahTemporalPointminusNanos(TimeSupport timeSupport, Number nanosToSubtract) Subtracts a specified number of nanoseconds from the givenTimeSupportinstance.static NaftahDurationminusSeconds(NaftahDuration d, Number seconds) Subtracts seconds from a duration.static NaftahPeriodWithDurationminusSeconds(NaftahPeriodWithDuration pd, Number seconds) Subtracts seconds from a period with duration.static NaftahTemporalPointminusSeconds(TimeSupport timeSupport, Number secondsToSubtract) Subtracts a specified number of seconds from the givenTimeSupportinstance.static NaftahTemporalPointminusWeeks(DateSupport dateSupport, Number weeksToSubtract) Subtracts a specified number of weeks from the givenDateSupportinstance.static NaftahTemporalPointminusYears(DateSupport dateSupport, Number yearsToSubtract) Subtracts a specified number of years from the givenDateSupportinstance.static NaftahPeriodminusYears(NaftahPeriod p, Number years) Subtracts a number of years from the given period.static NaftahPeriodWithDurationminusYears(NaftahPeriodWithDuration pd, Number years) Subtracts years from a period with duration.static NaftahTemporalPointplusDays(DateSupport dateSupport, Number daysToAdd) Adds a specified number of days to the givenDateSupportinstance.static NaftahDurationplusDays(NaftahDuration d, Number days) Adds a number of days to a given duration.static NaftahPeriodplusDays(NaftahPeriod p, Number days) Adds a number of days to the given period.static NaftahPeriodWithDurationplusDays(NaftahPeriodWithDuration pd, Number days) Adds days to a period with duration.static NaftahDurationplusHours(NaftahDuration d, Number hours) Adds a number of hours to a given duration.static NaftahPeriodWithDurationplusHours(NaftahPeriodWithDuration pd, Number hours) Adds hours to a period with duration.static NaftahTemporalPointplusHours(TimeSupport timeSupport, Number hoursToAdd) Adds a specified number of hours to the givenTimeSupportinstance.static NaftahDurationplusMillis(NaftahDuration d, Number millis) Adds milliseconds to a duration.static NaftahPeriodWithDurationplusMillis(NaftahPeriodWithDuration pd, Number millis) Adds milliseconds to a period with duration.static NaftahDurationplusMinutes(NaftahDuration d, Number minutes) Adds a number of minutes to a given duration.static NaftahPeriodWithDurationplusMinutes(NaftahPeriodWithDuration pd, Number minutes) Adds minutes to a period with duration.static NaftahTemporalPointplusMinutes(TimeSupport timeSupport, Number minutesToAdd) Adds a specified number of minutes to the givenTimeSupportinstance.static NaftahTemporalPointplusMonths(DateSupport dateSupport, Number monthsToAdd) Adds a specified number of months to the givenDateSupportinstance.static NaftahPeriodplusMonths(NaftahPeriod p, Number months) Adds a number of months to the given period.static NaftahPeriodWithDurationplusMonths(NaftahPeriodWithDuration pd, Number months) Adds months to a period with duration.static NaftahDurationplusNanos(NaftahDuration d, Number nanos) Adds nanoseconds to a duration.static NaftahPeriodWithDurationplusNanos(NaftahPeriodWithDuration pd, Number nanos) Adds nanoseconds to a period with duration.static NaftahTemporalPointplusNanos(TimeSupport timeSupport, Number nanosToAdd) Adds a specified number of nanoseconds to the givenTimeSupportinstance.static NaftahDurationplusSeconds(NaftahDuration d, Number seconds) Adds seconds to a duration.static NaftahPeriodWithDurationplusSeconds(NaftahPeriodWithDuration pd, Number seconds) Adds seconds to a period with duration.static NaftahTemporalPointplusSeconds(TimeSupport timeSupport, Number secondsToAdd) Adds a specified number of seconds to the givenTimeSupportinstance.static NaftahTemporalPointplusWeeks(DateSupport dateSupport, Number weeksToAdd) Adds a specified number of weeks to the givenDateSupportinstance.static NaftahTemporalPointplusYears(DateSupport dateSupport, Number yearsToAdd) Adds a specified number of years to the givenDateSupportinstance.static NaftahPeriodplusYears(NaftahPeriod p, Number years) Adds a number of years to the given period.static NaftahPeriodWithDurationplusYears(NaftahPeriodWithDuration pd, Number years) Adds years to a period with duration.static longtoEpochDay(DateSupport dateSupport) Converts the givenDateSupportinstance to the epoch day.
-
Constructor Details
-
TemporalBuiltinFunctions
private TemporalBuiltinFunctions()Private constructor to prevent instantiation. ThrowsNaftahBugErrorif called.
-
-
Method Details
-
currentTime
Obtains the current time using the system default time zone.- Returns:
- the current
NaftahTime
-
currentZonedTime
Obtains the current time using the specified time zone.- Parameters:
zone- the zone ID (e.g. Asia/Dubai)- Returns:
- the current
NaftahTime
-
currentOffsetTime
Obtains the current time using a fixed offset.- Parameters:
offset- the offset (e.g. +04:00)- Returns:
- the current
NaftahTime
-
createTime
Creates anNaftahTimeinstance from hour and minute.- Parameters:
hour- the hour valueminute- the minute value- Returns:
- a new
NaftahTimeinstance
-
createZonedTime
Creates a zonedNaftahTimeinstance from hour, minute, and time zone.- Parameters:
hour- the hour valueminute- the minute valuezone- the time zone ID (e.g. "Asia/Riyadh")- Returns:
- a new
NaftahTimeinstance with the specified zone
-
createOffsetTime
Creates an offsetNaftahTimeinstance from hour, minute, and offset.- Parameters:
hour- the hour valueminute- the minute valueoffset- the offset string (e.g. "+04:00")- Returns:
- a new
NaftahTimeinstance with the specified offset
-
createTime
Creates anNaftahTimeinstance from hour, minute, and second.- Parameters:
hour- the hour valueminute- the minute valuesecond- the second value- Returns:
- a new
NaftahTimeinstance
-
createZonedTime
Creates a zonedNaftahTimeinstance from hour, minute, second, and zone.- Parameters:
hour- the hour valueminute- the minute valuesecond- the second valuezone- the time zone ID- Returns:
- a new
NaftahTimeinstance with the specified zone
-
createOffsetTime
Creates an offsetNaftahTimeinstance from hour, minute, second, and offset.- Parameters:
hour- the hour valueminute- the minute valuesecond- the second valueoffset- the offset string- Returns:
- a new
NaftahTimeinstance with the specified offset
-
createTime
Creates anNaftahTimeinstance from hour, minute, second, and nanosecond.- Parameters:
hour- the hour valueminute- the minute valuesecond- the second valuenanoOfSecond- the nanosecond value- Returns:
- a new
NaftahTimeinstance
-
createZonedTime
public static NaftahTime createZonedTime(Number hour, Number minute, Number second, Number nanoOfSecond, String zone) Creates anNaftahTimeinstance from hour, minute, second, and nanosecond with a specific time zone.- Parameters:
hour- the hour valueminute- the minute valuesecond- the second valuenanoOfSecond- the nanosecond valuezone- the time zone ID (e.g., "Asia/Riyadh")- Returns:
- a new
NaftahTimeinstance with the specified zone
-
createOffsetTime
public static NaftahTime createOffsetTime(Number hour, Number minute, Number second, Number nanoOfSecond, String offset) Creates anNaftahTimeinstance from hour, minute, second, and nanosecond with a specific offset.- Parameters:
hour- the hour valueminute- the minute valuesecond- the second valuenanoOfSecond- the nanosecond valueoffset- the offset string (e.g., "+03:00")- Returns:
- a new
NaftahTimeinstance with the specified offset
-
createTimeOfSecondOfDay
Creates anNaftahTimeinstance from the total number of seconds since midnight.- Parameters:
secondOfDay- the total number of seconds since midnight (0–86,399)- Returns:
- a new
NaftahTimeinstance
-
createZonedTimeOfSecondOfDay
Creates anNaftahTimeinstance 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
NaftahTimeinstance with the specified zone
-
createOffsetTimeOfSecondOfDay
Creates anNaftahTimeinstance 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
NaftahTimeinstance with the specified offset
-
createTimeOfNanoOfDay
Creates anNaftahTimeinstance from the total number of nanoseconds since midnight.- Parameters:
nanoOfDay- the nano-of-day (0–86,399,999,999,999)- Returns:
- a new
NaftahTimeinstance
-
createZonedTimeOfNanoOfDay
Creates anNaftahTimeinstance 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
NaftahTimeinstance with the specified zone
-
createOffsetTimeOfNanoOfDay
Creates anNaftahTimeinstance 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
NaftahTimeinstance with the specified offset
-
currentDate
Obtains the current date using the default chronology.- Returns:
- the current
NaftahDate
-
currentChronologyDate
Obtains the current date using the specified chronology.- Parameters:
chronology- the chronology name- Returns:
- the current
NaftahDate
-
currentZonedDate
Obtains the current date using the specified time zone.- Parameters:
zone- the zone ID (e.g. Asia/Dubai)- Returns:
- the current
NaftahDate
-
currentOffsetDate
Obtains the current date using a fixed offset.- Parameters:
offset- the offset (e.g. +04:00)- Returns:
- the current
NaftahDate
-
currentZonedChronologyDate
Obtains the current date using the specified chronology and time zone.- Parameters:
chronology- the chronology namezone- the zone ID- Returns:
- the current
NaftahDate
-
currentOffsetChronologyDate
Obtains the current date using the specified chronology and offset.- Parameters:
chronology- the chronology nameoffset- the offset (e.g. +04:00)- Returns:
- the current
NaftahDate
-
createDate
Creates anNaftahDateinstance from day, month, and year.The
monthparameter may be either:- Parameters:
day- the day of month (1–31)month- the month value, either an Arabic month name (String) or a numeric month (Number), * not nullyear- the year value- Returns:
- a new
NaftahDateinstance - Throws:
IllegalArgumentException- ifmonthis neither aStringnor aNumber
-
createDate
Creates anNaftahDateinstance from a specific chronology, day, month, and year.The
monthparameter may be either:- 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 nullyear- the year value- Returns:
- a new
NaftahDateinstance with the specified chronology - Throws:
IllegalArgumentException- ifmonthis neither aStringnor aNumber
-
currentDateTime
Obtains the current date-time using the system default settings.- Returns:
- the current
NaftahDateTime
-
currentChronologyDateTime
Obtains the current date-time using a specific chronology.- Parameters:
chronology- the chronology name- Returns:
- the current
NaftahDateTime
-
currentZonedDateTime
Obtains the current date-time using the specified time zone.- Parameters:
zone- the zone ID- Returns:
- the current
NaftahDateTime
-
currentOffsetDateTime
Obtains the current date-time using a fixed offset.- Parameters:
offset- the offset (e.g. +04:00)- Returns:
- the current
NaftahDateTime
-
currentZonedChronologyDateTime
Obtains the current date-time using the specified chronology and time zone.- Parameters:
chronology- the chronology namezone- the zone ID- Returns:
- the current
NaftahDateTime
-
currentOffsetChronologyDateTime
Obtains the current date-time using the specified chronology and offset.- Parameters:
chronology- the chronology nameoffset- 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 anNaftahDateTimeinstance from year, month, day, hour, and minute.The
monthparameter may be either:Seconds and nanoseconds default to
0.- Parameters:
year- the year valuemonth- 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
NaftahDateTimeinstance - Throws:
IllegalArgumentException- ifmonthis neither aStringnor aNumber
-
createZonedDateTime
public static NaftahDateTime createZonedDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute, String zone) Creates anNaftahDateTimeinstance from year, month, day, hour, and minute using a specific time zone.The
monthparameter may be either: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
NaftahDateTimeinstance with the specified time zone - Throws:
IllegalArgumentException- ifmonthis neither aStringnor aNumber
-
createOffsetDateTime
public static NaftahDateTime createOffsetDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute, String offset) Creates anNaftahDateTimeinstance from year, month, day, hour, and minute using a fixed time offset.The
monthparameter may be either:Seconds and nanoseconds default to
0.- Parameters:
year- the year valuemonth- 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
NaftahDateTimeinstance with the specified offset - Throws:
IllegalArgumentException- ifmonthis neither aStringnor aNumber
-
createDateTime
public static NaftahDateTime createDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second) Creates anNaftahDateTimeinstance from year, month, day, hour, minute, and second.The
monthparameter may be either:Nanoseconds default to
0.- Parameters:
year- the year valuemonth- 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
NaftahDateTimeinstance - Throws:
IllegalArgumentException- ifmonthis neither aStringnor aNumber
-
createZonedDateTime
public static NaftahDateTime createZonedDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, String zone) Creates anNaftahDateTimeinstance from year, month, day, hour, minute, and second using a specific time zone.The
monthparameter may be either:Nanoseconds default to
0.- Parameters:
year- the year valuemonth- 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
NaftahDateTimeinstance with the specified time zone - Throws:
IllegalArgumentException- ifmonthis neither aStringnor aNumber
-
createOffsetDateTime
public static NaftahDateTime createOffsetDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, String offset) Creates anNaftahDateTimeinstance from year, month, day, hour, minute, and second using a fixed time offset.The
monthparameter may be either:Nanoseconds default to
0.- Parameters:
year- the year valuemonth- 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
NaftahDateTimeinstance with the specified offset - Throws:
IllegalArgumentException- ifmonthis neither aStringnor aNumber
-
createDateTime
public static NaftahDateTime createDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, Number nanoOfSecond) Creates anNaftahDateTimeinstance from year, month, day, hour, minute, second, and nanosecond.The
monthparameter may be either:- Parameters:
year- the year valuemonth- 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
NaftahDateTimeinstance - Throws:
IllegalArgumentException- ifmonthis neither aStringnor aNumber
-
createZonedDateTime
public static NaftahDateTime createZonedDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, Number nanoOfSecond, String zone) Creates anNaftahDateTimeinstance from year, month, day, hour, minute, second, and nanosecond using a specific time zone.The
monthparameter may be either:- Parameters:
year- the year valuemonth- 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
NaftahDateTimeinstance with the specified time zone - Throws:
IllegalArgumentException- ifmonthis neither aStringnor aNumber
-
createOffsetDateTime
public static NaftahDateTime createOffsetDateTime(Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, Number nanoOfSecond, String offset) Creates anNaftahDateTimeinstance from year, month, day, hour, minute, second, and nanosecond using a fixed offset.The
monthparameter may be either:- Parameters:
year- the year valuemonth- 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
NaftahDateTimeinstance with the specified offset - Throws:
IllegalArgumentException- ifmonthis neither aStringnor aNumber
-
createChronologyDateTime
public static NaftahDateTime createChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute) Creates anNaftahDateTimeinstance from year, month, day, hour, and minute using a specific chronology.The
monthparameter may be either:- Parameters:
chronology- the chronology name (e.g., "Hijri", "Gregorian")year- the year valuemonth- 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
NaftahDateTimeinstance with the specified chronology - Throws:
IllegalArgumentException- ifmonthis neither aStringnor aNumber
-
createZonedChronologyDateTime
public static NaftahDateTime createZonedChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute, String zone) Creates anNaftahDateTimeinstance from year, month, day, hour, and minute using a specific chronology and a time zone.The
monthparameter may be either:- Parameters:
chronology- the chronology name (e.g., "Hijri", "Gregorian")year- the year valuemonth- 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
NaftahDateTimeinstance with the specified chronology and zone - Throws:
IllegalArgumentException- ifmonthis neither aStringnor aNumber
-
createOffsetChronologyDateTime
public static NaftahDateTime createOffsetChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute, String offset) Creates anNaftahDateTimeinstance from year, month, day, hour, and minute using a specific chronology and a fixed offset.The
monthparameter may be either:- Parameters:
chronology- the chronology name (e.g., "Hijri", "Gregorian")year- the year valuemonth- 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
NaftahDateTimeinstance with the specified chronology and offset - Throws:
IllegalArgumentException- ifmonthis neither aStringnor aNumber
-
createChronologyDateTime
public static NaftahDateTime createChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second) Creates anNaftahDateTimeinstance from year, month, day, hour, minute, and second using a specific chronology.The
monthparameter may be either:- Parameters:
chronology- the chronology name (e.g., "Hijri", "Gregorian")year- the year valuemonth- 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
NaftahDateTimeinstance with the specified chronology - Throws:
IllegalArgumentException- ifmonthis neither aStringnor aNumber
-
createZonedChronologyDateTime
public static NaftahDateTime createZonedChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, String zone) Creates anNaftahDateTimeinstance from year, month, day, hour, minute, and second using a specific chronology and time zone.The
monthparameter may be either:- Parameters:
chronology- the chronology name (e.g., "Hijri", "Gregorian")year- the year valuemonth- 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
NaftahDateTimeinstance with the specified chronology and time zone - Throws:
IllegalArgumentException- ifmonthis neither aStringnor aNumber
-
createOffsetChronologyDateTime
public static NaftahDateTime createOffsetChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, String offset) Creates anNaftahDateTimeinstance from year, month, day, hour, minute, and second using a specific chronology and fixed offset.The
monthparameter may be either:- Parameters:
chronology- the chronology name (e.g., "Hijri", "Gregorian")year- the year valuemonth- 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
NaftahDateTimeinstance with the specified chronology and offset - Throws:
IllegalArgumentException- ifmonthis neither aStringnor aNumber
-
createChronologyDateTime
public static NaftahDateTime createChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, Number nanoOfSecond) Creates anNaftahDateTimeinstance from year, month, day, hour, minute, second, and nanosecond using a specific chronology.The
monthparameter may be either:- Parameters:
chronology- the chronology name (e.g., "Hijri", "Gregorian")year- the year valuemonth- 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
NaftahDateTimeinstance with the specified chronology and nanoseconds - Throws:
IllegalArgumentException- ifmonthis neither aStringnor aNumber
-
createZonedChronologyDateTime
public static NaftahDateTime createZonedChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, Number nanoOfSecond, String zone) Creates anNaftahDateTimeinstance from year, month, day, hour, minute, second, and nanosecond using a specific chronology and time zone.The
monthparameter may be either:- Parameters:
chronology- the chronology name (e.g., "Hijri", "Gregorian")year- the year valuemonth- 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
NaftahDateTimeinstance with the specified chronology and zone - Throws:
IllegalArgumentException- ifmonthis neither aStringnor aNumber
-
createOffsetChronologyDateTime
public static NaftahDateTime createOffsetChronologyDateTime(String chronology, Number year, Object month, Number dayOfMonth, Number hour, Number minute, Number second, Number nanoOfSecond, String offset) Creates anNaftahDateTimeinstance from year, month, day, hour, minute, second, and nanosecond using a specific chronology and fixed offset.The
monthparameter may be either:- Parameters:
chronology- the chronology name (e.g., "Hijri", "Gregorian")year- the year valuemonth- 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
NaftahDateTimeinstance with the specified chronology and offset - Throws:
IllegalArgumentException- ifmonthis neither aStringnor aNumber
-
toEpochDay
Converts the givenDateSupportinstance 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
Retrieves the year from a givenDateSupportinstance.- Parameters:
dateSupport- the date or date-time object- Returns:
- the year value
-
getMonthValue
Gets the month from a temporal point.- Parameters:
dateSupport- the temporal point- Returns:
- the month (1-12)
-
getMonth
Retrieves the month from a givenDateSupportinstance.- Parameters:
dateSupport- the date or date-time object- Returns:
- the month as a
String, which could be an Arabic month name
-
getDayOfMonth
Gets the day of the month from a temporal point.- Parameters:
dateSupport- the temporal point- Returns:
- the day of the month
-
getDayOfYear
Retrieves the day of the year from a givenDateSupportinstance.- Parameters:
dateSupport- the date or date-time object- Returns:
- the day of the year (1–365/366)
-
getDayOfWeek
Retrieves the day of the week from a givenDateSupportinstance.- Parameters:
dateSupport- the date or date-time object- Returns:
- the day of the week as a
String(e.g., "Monday", "Tuesday")
-
isLeapYear
Checks whether the year of the givenDateSupportinstance is a leap year.- Parameters:
dateSupport- the date or date-time object- Returns:
trueif the year is a leap year,falseotherwise
-
lengthOfMonth
Returns the number of days in the month of the givenDateSupportinstance.- Parameters:
dateSupport- the date or date-time object- Returns:
- the length of the month in days
-
lengthOfYear
Returns the number of days in the year of the givenDateSupportinstance.- Parameters:
dateSupport- the date or date-time object- Returns:
- the length of the year in days
-
plusYears
Adds a specified number of years to the givenDateSupportinstance.- Parameters:
dateSupport- the date or date-time objectyearsToAdd- the number of years to add (can be negative)- Returns:
- a new
NaftahTemporalPointrepresenting the resulting date-time
-
plusMonths
Adds a specified number of months to the givenDateSupportinstance.- Parameters:
dateSupport- the date or date-time objectmonthsToAdd- the number of months to add (can be negative)- Returns:
- a new
NaftahTemporalPointrepresenting the resulting date-time
-
plusWeeks
Adds a specified number of weeks to the givenDateSupportinstance.- Parameters:
dateSupport- the date or date-time objectweeksToAdd- the number of weeks to add (can be negative)- Returns:
- a new
NaftahTemporalPointrepresenting the resulting date-time
-
plusDays
Adds a specified number of days to the givenDateSupportinstance.- Parameters:
dateSupport- the date or date-time objectdaysToAdd- the number of days to add (can be negative)- Returns:
- a new
NaftahTemporalPointrepresenting the resulting date-time
-
minusYears
Subtracts a specified number of years from the givenDateSupportinstance.- Parameters:
dateSupport- the date or date-time objectyearsToSubtract- the number of years to subtract (can be negative)- Returns:
- a new
NaftahTemporalPointrepresenting the resulting date-time
-
minusMonths
Subtracts a specified number of months from the givenDateSupportinstance.- Parameters:
dateSupport- the date or date-time objectmonthsToSubtract- the number of months to subtract (can be negative)- Returns:
- a new
NaftahTemporalPointrepresenting the resulting date-time
-
minusWeeks
Subtracts a specified number of weeks from the givenDateSupportinstance.- Parameters:
dateSupport- the date or date-time objectweeksToSubtract- the number of weeks to subtract (can be negative)- Returns:
- a new
NaftahTemporalPointrepresenting the resulting date-time
-
minusDays
Subtracts a specified number of days from the givenDateSupportinstance.- Parameters:
dateSupport- the date or date-time objectdaysToSubtract- the number of days to subtract (can be negative)- Returns:
- a new
NaftahTemporalPointrepresenting the resulting date-time
-
getHour
Gets the hour of the day from a temporal point.- Parameters:
timeSupport- the temporal point- Returns:
- the hour (0-23)
-
getMinute
Gets the minute of the hour from a temporal point.- Parameters:
timeSupport- the temporal point- Returns:
- the minute
-
getSecond
Gets the second of the minute from a temporal point.- Parameters:
timeSupport- the temporal point- Returns:
- the second
-
getMilli
Gets the millisecond of the second from a temporal point.- Parameters:
timeSupport- the temporal point- Returns:
- the millisecond
-
getNano
Gets the nanosecond of the second from a temporal point.- Parameters:
timeSupport- the temporal point- Returns:
- the nanosecond
-
plusHours
Adds a specified number of hours to the givenTimeSupportinstance.- Parameters:
timeSupport- the time objecthoursToAdd- the number of hours to add (can be negative)- Returns:
- a new
NaftahTemporalPointrepresenting the resulting time
-
plusMinutes
Adds a specified number of minutes to the givenTimeSupportinstance.- Parameters:
timeSupport- the time objectminutesToAdd- the number of minutes to add (can be negative)- Returns:
- a new
NaftahTemporalPointrepresenting the resulting time
-
plusSeconds
Adds a specified number of seconds to the givenTimeSupportinstance.- Parameters:
timeSupport- the time objectsecondsToAdd- the number of seconds to add (can be negative)- Returns:
- a new
NaftahTemporalPointrepresenting the resulting time
-
plusNanos
Adds a specified number of nanoseconds to the givenTimeSupportinstance.- Parameters:
timeSupport- the time objectnanosToAdd- the number of nanoseconds to add (can be negative)- Returns:
- a new
NaftahTemporalPointrepresenting the resulting time
-
minusHours
Subtracts a specified number of hours from the givenTimeSupportinstance.- Parameters:
timeSupport- the time objecthoursToSubtract- the number of hours to subtract (can be negative)- Returns:
- a new
NaftahTemporalPointrepresenting the resulting time
-
minusMinutes
Subtracts a specified number of minutes from the givenTimeSupportinstance.- Parameters:
timeSupport- the time objectminutesToSubtract- the number of minutes to subtract (can be negative)- Returns:
- a new
NaftahTemporalPointrepresenting the resulting time
-
minusSeconds
Subtracts a specified number of seconds from the givenTimeSupportinstance.- Parameters:
timeSupport- the time objectsecondsToSubtract- the number of seconds to subtract (can be negative)- Returns:
- a new
NaftahTemporalPointrepresenting the resulting time
-
minusNanos
Subtracts a specified number of nanoseconds from the givenTimeSupportinstance.- Parameters:
timeSupport- the time objectnanosToSubtract- the number of nanoseconds to subtract (can be negative)- Returns:
- a new
NaftahTemporalPointrepresenting the resulting time
-
createZeroDuration
Creates a zero duration.- Returns:
- a
NaftahDurationrepresenting zero duration
-
createDurationFromDays
Creates a duration from the specified number of days.- Parameters:
days- the number of days- Returns:
- a
NaftahDurationrepresenting the specified days
-
createDurationFromHours
Creates a duration from the specified number of hours.- Parameters:
hours- the number of hours- Returns:
- a
NaftahDurationrepresenting the specified hours
-
createDurationFromMinutes
Creates a duration from the specified number of minutes.- Parameters:
minutes- the number of minutes- Returns:
- a
NaftahDurationrepresenting the specified minutes
-
createDurationFromSeconds
Creates a duration from the specified number of seconds.- Parameters:
seconds- the number of seconds- Returns:
- a
NaftahDurationrepresenting 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 secondsnanoAdjustment- the nanosecond adjustment- Returns:
- a
NaftahDurationrepresenting the specified seconds and nano adjustment
-
createDurationFromMillis
Creates a duration from the specified number of milliseconds.- Parameters:
millis- the number of milliseconds- Returns:
- a
NaftahDurationrepresenting the specified milliseconds
-
createDurationFromNanos
Creates a duration from the specified number of nanoseconds.- Parameters:
nanos- the number of nanoseconds- Returns:
- a
NaftahDurationrepresenting the specified nanoseconds
-
createZeroPeriod
Creates a zero period.- Returns:
- a
NaftahPeriodrepresenting zero period
-
createPeriodFromYears
Creates a period from the specified number of years.- Parameters:
years- the number of years- Returns:
- a
NaftahPeriodrepresenting the specified years
-
createPeriodFromMonths
Creates a period from the specified number of months.- Parameters:
months- the number of months- Returns:
- a
NaftahPeriodrepresenting the specified months
-
createPeriodFromWeeks
Creates a period from the specified number of weeks.- Parameters:
weeks- the number of weeks- Returns:
- a
NaftahPeriodrepresenting the specified weeks
-
createPeriodFromDays
Creates a period from the specified number of days.- Parameters:
days- the number of days- Returns:
- a
NaftahPeriodrepresenting the specified days
-
createZeroPeriodWithDuration
Creates a period with duration of zero (both period and duration are zero).- Returns:
- a
NaftahPeriodWithDurationrepresenting zero period and zero duration
-
createPeriodWithDurationFromYears
Creates a period with duration from the specified number of years.- Parameters:
years- the number of years- Returns:
- a
NaftahPeriodWithDurationwith specified years and zero duration
-
createPeriodWithDurationFromMonths
Creates a period with duration from the specified number of months.- Parameters:
months- the number of months- Returns:
- a
NaftahPeriodWithDurationwith specified months and zero duration
-
createPeriodWithDurationFromWeeks
Creates a period with duration from the specified number of weeks.- Parameters:
weeks- the number of weeks- Returns:
- a
NaftahPeriodWithDurationwith specified weeks and zero duration
-
createPeriodWithDurationFromDays
Creates a period with duration from the specified number of days.- Parameters:
days- the number of days- Returns:
- a
NaftahPeriodWithDurationwith specified days and zero duration
-
createPeriodWithDurationFromHours
Creates a period with duration from the specified number of hours.- Parameters:
hours- the number of hours- Returns:
- a
NaftahPeriodWithDurationwith zero period and specified hours as duration
-
createPeriodWithDurationFromMinutes
Creates a period with duration from the specified number of minutes.- Parameters:
minutes- the number of minutes- Returns:
- a
NaftahPeriodWithDurationwith zero period and specified minutes as duration
-
createPeriodWithDurationFromSeconds
Creates a period with duration from the specified number of seconds.- Parameters:
seconds- the number of seconds- Returns:
- a
NaftahPeriodWithDurationwith 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 secondsnanoAdjustment- the nanosecond adjustment- Returns:
- a
NaftahPeriodWithDurationwith zero period and adjusted duration
-
createPeriodWithDurationFromMillis
Creates a period with duration from the specified number of milliseconds.- Parameters:
millis- the number of milliseconds- Returns:
- a
NaftahPeriodWithDurationwith zero period and specified milliseconds as duration
-
createPeriodWithDurationFromNanos
Creates a period with duration from the specified number of nanoseconds.- Parameters:
nanos- the number of nanoseconds- Returns:
- a
NaftahPeriodWithDurationwith zero period and specified nanoseconds as duration
-
plusYears
Adds a number of years to the given period.- Parameters:
p- the original periodyears- the number of years to add- Returns:
- a
NaftahPeriodwith years added
-
plusMonths
Adds a number of months to the given period.- Parameters:
p- the original periodmonths- the number of months to add- Returns:
- a
NaftahPeriodwith months added
-
plusDays
Adds a number of days to the given period.- Parameters:
p- the original perioddays- the number of days to add- Returns:
- a
NaftahPeriodwith days added
-
minusYears
Subtracts a number of years from the given period.- Parameters:
p- the original periodyears- the number of years to subtract- Returns:
- a
NaftahPeriodwith years subtracted
-
minusMonths
Subtracts a number of months from the given period.- Parameters:
p- the original periodmonths- the number of months to subtract- Returns:
- a
NaftahPeriodwith months subtracted
-
minusDays
Subtracts a number of days from the given period.- Parameters:
p- the original perioddays- the number of days to subtract- Returns:
- a
NaftahPeriodwith days subtracted
-
plusDays
Adds a number of days to a given duration.- Parameters:
d- the original durationdays- the number of days to add- Returns:
- a
NaftahDurationwith days added
-
plusHours
Adds a number of hours to a given duration.- Parameters:
d- the original durationhours- the number of hours to add- Returns:
- a
NaftahDurationwith hours added
-
plusMinutes
Adds a number of minutes to a given duration.- Parameters:
d- the original durationminutes- the number of minutes to add- Returns:
- a
NaftahDurationwith minutes added
-
plusSeconds
Adds seconds to a duration.- Parameters:
d- the durationseconds- the number of seconds to add- Returns:
- a new duration with the added seconds
-
plusMillis
Adds milliseconds to a duration.- Parameters:
d- the durationmillis- the number of milliseconds to add- Returns:
- a new duration with the added milliseconds
-
plusNanos
Adds nanoseconds to a duration.- Parameters:
d- the durationnanos- the number of nanoseconds to add- Returns:
- a new duration with the added nanoseconds
-
minusDays
Subtracts days from a duration.- Parameters:
d- the durationdays- the number of days to subtract- Returns:
- a new duration with the days subtracted
-
minusHours
Subtracts hours from a duration.- Parameters:
d- the durationhours- the number of hours to subtract- Returns:
- a new duration with the hours subtracted
-
minusMinutes
Subtracts minutes from a duration.- Parameters:
d- the durationminutes- the number of minutes to subtract- Returns:
- a new duration with the minutes subtracted
-
minusSeconds
Subtracts seconds from a duration.- Parameters:
d- the durationseconds- the number of seconds to subtract- Returns:
- a new duration with the seconds subtracted
-
minusMillis
Subtracts milliseconds from a duration.- Parameters:
d- the durationmillis- the number of milliseconds to subtract- Returns:
- a new duration with the milliseconds subtracted
-
minusNanos
Subtracts nanoseconds from a duration.- Parameters:
d- the durationnanos- the number of nanoseconds to subtract- Returns:
- a new duration with the nanoseconds subtracted
-
plusYears
Adds years to a period with duration.- Parameters:
pd- the period with durationyears- the number of years to add- Returns:
- a new period with duration with the added years
-
plusMonths
Adds months to a period with duration.- Parameters:
pd- the period with durationmonths- the number of months to add- Returns:
- a new period with duration with the added months
-
plusDays
Adds days to a period with duration.- Parameters:
pd- the period with durationdays- the number of days to add- Returns:
- a new period with duration with the added days
-
plusHours
Adds hours to a period with duration.- Parameters:
pd- the period with durationhours- the number of hours to add- Returns:
- a new period with duration with the added hours
-
plusMinutes
Adds minutes to a period with duration.- Parameters:
pd- the period with durationminutes- the number of minutes to add- Returns:
- a new period with duration with the added minutes
-
plusSeconds
Adds seconds to a period with duration.- Parameters:
pd- the period with durationseconds- the number of seconds to add- Returns:
- a new period with duration with the added seconds
-
plusMillis
Adds milliseconds to a period with duration.- Parameters:
pd- the period with durationmillis- the number of milliseconds to add- Returns:
- a new period with duration with the added milliseconds
-
plusNanos
Adds nanoseconds to a period with duration.- Parameters:
pd- the period with durationnanos- the number of nanoseconds to add- Returns:
- a new period with duration with the added nanoseconds
-
minusYears
Subtracts years from a period with duration.- Parameters:
pd- the period with durationyears- the number of years to subtract- Returns:
- a new period with duration with the years subtracted
-
minusMonths
Subtracts months from a period with duration.- Parameters:
pd- the period with durationmonths- the number of months to subtract- Returns:
- a new period with duration with the months subtracted
-
minusDays
Subtracts days from a period with duration.- Parameters:
pd- the period with durationdays- the number of days to subtract- Returns:
- a new period with duration with the days subtracted
-
minusHours
Subtracts hours from a period with duration.- Parameters:
pd- the period with durationhours- the number of hours to subtract- Returns:
- a new period with duration with the hours subtracted
-
minusMinutes
Subtracts minutes from a period with duration.- Parameters:
pd- the period with durationminutes- the number of minutes to subtract- Returns:
- a new period with duration with the minutes subtracted
-
minusSeconds
Subtracts seconds from a period with duration.- Parameters:
pd- the period with durationseconds- the number of seconds to subtract- Returns:
- a new period with duration with the seconds subtracted
-
minusMillis
Subtracts milliseconds from a period with duration.- Parameters:
pd- the period with durationmillis- the number of milliseconds to subtract- Returns:
- a new period with duration with the milliseconds subtracted
-
minusNanos
Subtracts nanoseconds from a period with duration.- Parameters:
pd- the period with durationnanos- the number of nanoseconds to subtract- Returns:
- a new period with duration with the nanoseconds subtracted
-
getYears
Gets the number of years in a period.- Parameters:
p- the period- Returns:
- the number of years
-
getMonths
Gets the number of months in a period.- Parameters:
p- the period- Returns:
- the number of months
-
getDays
Gets the number of days in a period.- Parameters:
p- the period- Returns:
- the number of days
-
getHours
Gets the number of hours in a duration.- Parameters:
d- the duration- Returns:
- the number of hours
-
getMinutes
Gets the number of minutes in a duration.- Parameters:
d- the duration- Returns:
- the number of minutes
-
getSeconds
Gets the number of seconds in a duration.- Parameters:
d- the duration- Returns:
- the number of seconds
-
getMillis
Gets the number of milliseconds in a duration.- Parameters:
d- the duration- Returns:
- the number of milliseconds
-
getNano
Gets the number of nanoseconds in a duration.- Parameters:
d- the duration- Returns:
- the number of nanoseconds
-
getYears
Gets the number of years from a period with duration.- Parameters:
p- the period with duration- Returns:
- the number of years
-
getMonths
Gets the number of months from a period with duration.- Parameters:
p- the period with duration- Returns:
- the number of months
-
getDays
Gets the number of days from a period with duration.- Parameters:
p- the period with duration- Returns:
- the number of days
-
getHours
Gets the number of hours from a period with duration.- Parameters:
d- the period with duration- Returns:
- the number of hours
-
getMinutes
Gets the number of minutes from a period with duration.- Parameters:
d- the period with duration- Returns:
- the number of minutes
-
getSeconds
Gets the number of seconds from a period with duration.- Parameters:
d- the period with duration- Returns:
- the number of seconds
-
getMillis
Gets the number of milliseconds from a period with duration.- Parameters:
d- the period with duration- Returns:
- the number of milliseconds
-
getNano
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 pointright- the second temporal point- Returns:
- the temporal amount between the two points
-