protocol
time_scales_protocol
Time scales conversion protocol for UTC, TAI, TT, UT1, TDB, GPS, GST, TCG, and TCB.
logtalk_load(time_scales(loader))staticPublic predicates
valid_scale/1
True when the argument is a supported time scale (utc, tai, tt, ut1, tdb, gps, gst, tcg, or tcb).
staticvalid_scale(Scale)valid_scale(@atom) - zero_or_onesupported_range/2
Returns the supported UTC datetime range as date_time(Year,Month,Day,Hour,Minute,Second) terms.
staticsupported_range(StartUTC,EndUTC)supported_range(-compound,-compound) - oneleap_second_date/2
Enumerates UTC effective dates for TAI-UTC step changes and their resulting offset in SI seconds.
staticleap_second_date(UTCDateTime,OffsetSeconds)leap_second_date(?compound,?integer) - zero_or_moreload_leap_seconds_override/1
Loads leap-second override data from a user-provided file containing leap(UnixSeconds,OffsetSeconds). terms.
staticload_leap_seconds_override(File)load_leap_seconds_override(+atom) - oneclear_leap_seconds_override/0
Clears any previously loaded leap-second override data and reverts to bundled data.
staticclear_leap_seconds_override - oneleap_seconds_source/1
Returns the active leap-seconds data source as either bundled or override.
staticleap_seconds_source(Source)leap_seconds_source(-atom) - oneleap_seconds_entries/1
Returns the active leap-seconds table as an ordered list of leap(UnixSeconds,OffsetSeconds) terms.
staticleap_seconds_entries(Entries)leap_seconds_entries(-list) - onesave_leap_seconds_entries/1
Saves the active leap-seconds table to a file as leap(UnixSeconds,OffsetSeconds). terms.
staticsave_leap_seconds_entries(File)save_leap_seconds_entries(+atom) - oneload_dut1_override/1
Loads DUT1 override data from a user-provided file containing dut1(UnixSeconds,Numerator,Denominator). terms.
staticload_dut1_override(File)load_dut1_override(+atom) - oneclear_dut1_override/0
Clears any previously loaded DUT1 override data and reverts to bundled data.
staticclear_dut1_override - onedut1_source/1
Returns the active DUT1 data source as either bundled or override.
staticdut1_source(Source)dut1_source(-atom) - onedut1_entries/1
Returns the active DUT1 table as an ordered list of dut1(UnixSeconds,Numerator,Denominator) terms.
staticdut1_entries(Entries)dut1_entries(-list) - onesave_dut1_entries/1
Saves the active DUT1 table to a file as dut1(UnixSeconds,Numerator,Denominator). terms.
staticsave_dut1_entries(File)save_dut1_entries(+atom) - oneutc_date_time_to_instant/2
Converts a UTC datetime term to an instant represented as instant(utc,Seconds,fraction(Numerator,Denominator)) where Seconds are Unix epoch seconds and the fractional component is normalized.
staticutc_date_time_to_instant(UTCDateTime,Instant)utc_date_time_to_instant(+compound,-compound) - zero_or_onevalid_instant/1
True when the argument is a valid supported instant term instant(Scale,Seconds,fraction(Numerator,Denominator)).
staticvalid_instant(Instant)valid_instant(+compound) - zero_or_onecheck_instant/1
Checks an instant term and throws an error instead of failing on invalid input.
staticcheck_instant(Instant)check_instant(+compound) - one_or_errorInstant is a variable:instantiation_errorInstant is not a valid instant term:domain_error(instant,Instant)Scale in Instant is neither a variable nor an atom:type_error(atom,Scale)Scale in Instant is not supported:domain_error(time_scale,Scale)Seconds in Instant is neither a variable nor an integer:type_error(integer,Seconds)Seconds in Instant is before supported UTC epoch:domain_error(utc_unix_seconds,Seconds)Instant is not of the form fraction(Numerator,Denominator):domain_error(fraction,Fraction)Numerator in Instant is neither a variable nor an integer:type_error(integer,Numerator)Denominator in Instant is neither a variable nor an integer:type_error(integer,Denominator)Denominator in Instant is not positive:domain_error(positive_denominator,Denominator)Instant is not in the [0,1[ interval:domain_error(normalized_fraction,Fraction)valid_conversion/3
True when an instant is valid for FromScale and conversion to ToScale is admissible.
staticvalid_conversion(Instant,FromScale,ToScale)valid_conversion(+compound,+atom,+atom) - zero_or_onecheck_conversion/3
Checks a conversion request and throws an error instead of failing on invalid input.
staticcheck_conversion(Instant,FromScale,ToScale)check_conversion(+compound,+atom,+atom) - one_or_errorInstant, FromScale, or ToScale is a variable:instantiation_errorFromScale is neither a variable nor an atom:type_error(atom,FromScale)ToScale is neither a variable nor an atom:type_error(atom,ToScale)FromScale is not supported:domain_error(time_scale,FromScale)ToScale is not supported:domain_error(time_scale,ToScale)Instant is not a valid instant term:domain_error(instant,Instant)Scale in Instant is neither a variable nor an atom:type_error(atom,Scale)Scale in Instant is not supported:domain_error(time_scale,Scale)Seconds in Instant is neither a variable nor an integer:type_error(integer,Seconds)Seconds in Instant is before supported UTC epoch:domain_error(utc_unix_seconds,Seconds)Instant is not of the form fraction(Numerator,Denominator):domain_error(fraction,Fraction)Numerator in Instant is neither a variable nor an integer:type_error(integer,Numerator)Denominator in Instant is neither a variable nor an integer:type_error(integer,Denominator)Denominator in Instant is not positive:domain_error(positive_denominator,Denominator)Instant is not in the [0,1[ interval:domain_error(normalized_fraction,Fraction)Instant scale does not match FromScale:domain_error(scale_mismatch,instant_scale(InstantScale,FromScale))instant_to_utc_date_time/2
Converts an UTC instant represented as instant(utc,Seconds,fraction(Numerator,Denominator)) to a UTC datetime term. Requires zero fractional part.
staticinstant_to_utc_date_time(Instant,UTCDateTime)instant_to_utc_date_time(+compound,-compound) - zero_or_oneconvert/4
Converts an instant(Scale,Seconds,fraction(Numerator,Denominator)) from FromScale to ToScale.
staticconvert(Instant,FromScale,ToScale,ConvertedInstant)convert(+compound,+atom,+atom,-compound) - zero_or_onecheck_convert/4
Converts an instant from FromScale to ToScale and throws an error instead of failing on invalid input.
staticcheck_convert(Instant,FromScale,ToScale,ConvertedInstant)check_convert(+compound,+atom,+atom,-compound) - one_or_errorInstant, FromScale, or ToScale is a variable:instantiation_errorFromScale is neither a variable nor an atom:type_error(atom,FromScale)ToScale is neither a variable nor an atom:type_error(atom,ToScale)FromScale is not supported:domain_error(time_scale,FromScale)ToScale is not supported:domain_error(time_scale,ToScale)Instant is not a valid instant term:domain_error(instant,Instant)Scale in Instant is neither a variable nor an atom:type_error(atom,Scale)Scale in Instant is not supported:domain_error(time_scale,Scale)Seconds in Instant is neither a variable nor an integer:type_error(integer,Seconds)Seconds in Instant is before supported UTC epoch:domain_error(utc_unix_seconds,Seconds)Instant is not of the form fraction(Numerator,Denominator):domain_error(fraction,Fraction)Numerator in Instant is neither a variable nor an integer:type_error(integer,Numerator)Denominator in Instant is neither a variable nor an integer:type_error(integer,Denominator)Denominator in Instant is not positive:domain_error(positive_denominator,Denominator)Instant is not in the [0,1[ interval:domain_error(normalized_fraction,Fraction)Instant scale does not match FromScale:domain_error(scale_mismatch,instant_scale(InstantScale,FromScale))offset/3
Returns the offset required to convert an instant to a target scale as rational(Numerator,Denominator).
staticoffset(Instant,ToScale,Offset)offset(+compound,+atom,-compound) - zero_or_onecheck_offset/3
Returns the conversion offset and throws an error instead of failing on invalid input.
staticcheck_offset(Instant,ToScale,Offset)check_offset(+compound,+atom,-compound) - one_or_errorInstant or ToScale is a variable:instantiation_errorToScale is neither a variable nor an atom:type_error(atom,ToScale)ToScale is not supported:domain_error(time_scale,ToScale)Instant is not a valid instant term:domain_error(instant,Instant)Scale in Instant is neither a variable nor an atom:type_error(atom,Scale)Scale in Instant is not supported:domain_error(time_scale,Scale)Seconds in Instant is neither a variable nor an integer:type_error(integer,Seconds)Seconds in Instant is before supported UTC epoch:domain_error(utc_unix_seconds,Seconds)Instant is not of the form fraction(Numerator,Denominator):domain_error(fraction,Fraction)Numerator in Instant is neither a variable nor an integer:type_error(integer,Numerator)Denominator in Instant is neither a variable nor an integer:type_error(integer,Denominator)Denominator in Instant is not positive:domain_error(positive_denominator,Denominator)Instant is not in the [0,1[ interval:domain_error(normalized_fraction,Fraction)Protected predicates
(none)
Private predicates
(none)
Operators
(none)
See also