object

# `time_scales_data`

Bundled and override data plus constants for UTC/TAI/TT/UT1/TDB/TCG/TCB conversions.

Availability:
`logtalk_load(time_scales(loader))`
Author: Paulo Moura
Version: 0:2:0
Date: 2026-02-26
Compilation flags:
`static, context_switching_calls`
Uses:
logtalk
Remarks:
(none)
Inherited public predicates:
(none)

## Public predicates

### `load_leap_seconds_override/1`

Loads leap-second override data from a file containing `leap(UnixSeconds,OffsetSeconds).` terms.

Compilation flags:
`static`
Template:
`load_leap_seconds_override(File)`
Mode and number of proofs:
`load_leap_seconds_override(+atom)` - `one`
Remarks:

> - Term format: Each term must be of the form `leap(UnixSeconds,OffsetSeconds).`.

> - Term ordering: Terms must be sorted by increasing `UnixSeconds`.

> - Value constraints: `UnixSeconds` must be an integer greater than or equal to `63072000` and `OffsetSeconds` must be a non-decreasing integer sequence.

### `clear_leap_seconds_override/0`

Clears leap-second override data and reverts to bundled data.

Compilation flags:
`static`
Mode and number of proofs:
`clear_leap_seconds_override` - `one`

### `leap_seconds_source/1`

Returns the active leap-seconds data source as `bundled` or `override`.

Compilation flags:
`static`
Template:
`leap_seconds_source(Source)`
Mode and number of proofs:
`leap_seconds_source(-atom)` - `one`

### `leap_seconds_entries/1`

Returns the active leap-seconds data as an ordered list of `leap(UnixSeconds,OffsetSeconds)` terms.

Compilation flags:
`static`
Template:
`leap_seconds_entries(Entries)`
Mode and number of proofs:
`leap_seconds_entries(-list)` - `one`

### `save_leap_seconds_entries/1`

Saves the active leap-seconds data to a file using `leap(UnixSeconds,OffsetSeconds).` terms.

Compilation flags:
`static`
Template:
`save_leap_seconds_entries(File)`
Mode and number of proofs:
`save_leap_seconds_entries(+atom)` - `one`

### `load_dut1_override/1`

Loads DUT1 override data from a file containing `dut1(UnixSeconds,Numerator,Denominator).` terms.

Compilation flags:
`static`
Template:
`load_dut1_override(File)`
Mode and number of proofs:
`load_dut1_override(+atom)` - `one`
Remarks:

> - Term format: Each term must be of the form `dut1(UnixSeconds,Numerator,Denominator).`.

> - Term ordering: Terms must be sorted by increasing `UnixSeconds`.

> - Value constraints: `UnixSeconds` and `Numerator` must be integers; `Denominator` must be a positive integer; `UnixSeconds` must be greater than or equal to `63072000`.

### `clear_dut1_override/0`

Clears DUT1 override data and reverts to bundled data.

Compilation flags:
`static`
Mode and number of proofs:
`clear_dut1_override` - `one`

### `dut1_source/1`

Returns the active DUT1 data source as `bundled` or `override`.

Compilation flags:
`static`
Template:
`dut1_source(Source)`
Mode and number of proofs:
`dut1_source(-atom)` - `one`

### `dut1_entries/1`

Returns the active DUT1 data as an ordered list of `dut1(UnixSeconds,Numerator,Denominator)` terms.

Compilation flags:
`static`
Template:
`dut1_entries(Entries)`
Mode and number of proofs:
`dut1_entries(-list)` - `one`

### `save_dut1_entries/1`

Saves the active DUT1 data to a file using `dut1(UnixSeconds,Numerator,Denominator).` terms.

Compilation flags:
`static`
Template:
`save_dut1_entries(File)`
Mode and number of proofs:
`save_dut1_entries(+atom)` - `one`

### `leap_offset_at_utc_unix/2`

Returns the `TAI-UTC` offset in SI seconds for a given UTC Unix epoch second within the supported range.

Compilation flags:
`static`
Template:
`leap_offset_at_utc_unix(UnixSeconds,OffsetSeconds)`
Mode and number of proofs:
`leap_offset_at_utc_unix(+integer,-integer)` - `zero_or_one`

### `leap_effective_date/2`

Enumerates UTC effective dates for `TAI-UTC` offset changes and their resulting offset in SI seconds.

Compilation flags:
`static`
Template:
`leap_effective_date(UTCDateTime,OffsetSeconds)`
Mode and number of proofs:
`leap_effective_date(?compound,?integer)` - `zero_or_more`

### `tt_minus_tai/2`

Returns the constant TT minus TAI offset as a rational value `Numerator/Denominator` seconds.

Compilation flags:
`static`
Template:
`tt_minus_tai(Numerator,Denominator)`
Mode and number of proofs:
`tt_minus_tai(-integer,-integer)` - `one`

### `dut1_offset_at_utc_unix/3`

Returns DUT1 (`UT1-UTC`) at a UTC Unix epoch second as a rational value `Numerator/Denominator`.

Compilation flags:
`static`
Template:
`dut1_offset_at_utc_unix(UnixSeconds,Numerator,Denominator)`
Mode and number of proofs:
`dut1_offset_at_utc_unix(+integer,-integer,-integer)` - `zero_or_one`

### `tdb_minus_tt_approx/3`

Returns an approximate `TDB-TT` offset in seconds for a TT instant represented by integer seconds and normalized fraction.

Compilation flags:
`static`
Template:
`tdb_minus_tt_approx(TTSeconds,Fraction,OffsetSeconds)`
Mode and number of proofs:
`tdb_minus_tt_approx(+integer,+compound,-float)` - `one`

### `tcg_minus_tt_approx/3`

Returns an approximate `TCG-TT` offset in seconds for a TT instant represented by integer seconds and normalized fraction.

Compilation flags:
`static`
Template:
`tcg_minus_tt_approx(TTSeconds,Fraction,OffsetSeconds)`
Mode and number of proofs:
`tcg_minus_tt_approx(+integer,+compound,-float)` - `one`

### `tcb_minus_tdb_approx/3`

Returns an approximate `TCB-TDB` offset in seconds for a TDB instant represented by integer seconds and normalized fraction.

Compilation flags:
`static`
Template:
`tcb_minus_tdb_approx(TDBSeconds,Fraction,OffsetSeconds)`
Mode and number of proofs:
`tcb_minus_tdb_approx(+integer,+compound,-float)` - `one`

### `tai_minus_utc_for_tai_unix/2`

Returns the `TAI-UTC` offset in SI seconds for a given TAI instant represented as Unix-like integer seconds.

Compilation flags:
`static`
Template:
`tai_minus_utc_for_tai_unix(TAISeconds,OffsetSeconds)`
Mode and number of proofs:
`tai_minus_utc_for_tai_unix(+integer,-integer)` - `zero_or_one`

## Protected predicates

(no local declarations; see entity ancestors if any)

## Private predicates

(no local declarations; see entity ancestors if any)

## Operators

(none)