protocol
tzif_protocol
Protocol for loading TZif data sets, persisting loaded terms, and answering zone-aware UTC-based offset, DST, and abbreviation queries.
logtalk_load(tzif(loader))staticPublic predicates
load/1
Loads a TZif source given as file(Path, ZoneId), files(Root, Paths), directory(Root), stream(Stream, ZoneId), bytes(Bytes, ZoneId), or snapshot(File) and caches the resulting per-zone tzif(...) terms, replacing cached entries with matching zone identifiers. For directory(Root) sources, regular files whose relative paths are not recognized zone identifiers are ignored, allowing system zoneinfo trees that contain metadata files such as leapseconds. Zone identifiers are validated against bundled IANA TZDB 2026a canonical names plus backward-compatible aliases.
staticload(Source)load(+compound) - zero_or_oneload/2
Loads a TZif source given as file(Path, ZoneId), files(Root, Paths), directory(Root), stream(Stream, ZoneId), bytes(Bytes, ZoneId), or snapshot(File) into a list of per-zone tzif(...) compound terms without caching them. For directory(Root) sources, regular files whose relative paths are not recognized zone identifiers are ignored, allowing system zoneinfo trees that contain metadata files such as leapseconds. Zone identifiers are validated against bundled IANA TZDB 2026a canonical names plus backward-compatible aliases.
staticload(Source,TZifs)load(+compound,-list(compound)) - zero_or_onecache/1
Caches one or more loaded per-zone tzif(...) compound terms, replacing cached entries with matching zone identifiers.
staticcache(TZifs)cache(+list(compound)) - onesave/2
Saves a list of per-zone tzif(...) terms to a plain Prolog snapshot file, writing one serialized term per line.
staticsave(TZifs,File)save(+list(compound),+atom) - onesave/1
Saves all cached tzif(...) terms to a plain Prolog snapshot file.
staticsave(File)save(+atom) - one_or_errorclear_cache/0
Clears all cached TZif terms.
staticclear_cache - onecache_source/1
Enumerates the source terms recorded in the cached TZif terms.
staticcache_source(Source)cache_source(-compound) - zero_or_morecached_tzif/1
Enumerates the cached per-zone tzif(...) terms.
staticcached_tzif(TZif)cached_tzif(-compound) - zero_or_morezone/3
Returns the loaded zone identifier and its nested parsed zone-data term from a per-zone tzif(...) term.
staticzone(TZif,Zone,ZoneData)zone(+compound,?atom,-compound) - zero_or_onezones/2
Returns the list of zone identifiers loaded in a list of per-zone tzif(...) terms.
staticzones(TZifs,Zones)zones(+list(compound),-list(atom)) - onezones/1
Returns the list of zone identifiers loaded in the cached tzif(...) terms.
staticzones(Zones)zones(-list(atom)) - one_or_errortime_type/4
Returns the applicable local time type for a loaded zone and a UTC instant given either as Unix seconds or as a date_time/6 term.
statictime_type(TZif,Zone,UTC,TimeType)time_type(+compound,+atom,+types([integer,compound]),-compound) - zero_or_onetime_type/3
Returns the applicable local time type for a zone in the cached TZif terms.
statictime_type(Zone,UTC,TimeType)time_type(+atom,+types([integer,compound]),-compound) - one_or_errortime_type/2
Cached single-zone convenience variant of time_type/3 using the cached TZif terms; requires exactly one cached zone.
statictime_type(UTC,TimeType)time_type(+types([integer,compound]),-compound) - one_or_erroroffset/4
Returns the UTC offset in seconds for a loaded zone and a UTC instant.
staticoffset(TZif,Zone,UTC,OffsetSeconds)offset(+compound,+atom,+types([integer,compound]),-integer) - zero_or_oneoffset/3
Returns the UTC offset in seconds for a zone in the cached TZif terms.
staticoffset(Zone,UTC,OffsetSeconds)offset(+atom,+types([integer,compound]),-integer) - one_or_erroroffset/2
Cached single-zone convenience variant of offset/3 using the cached TZif terms; requires exactly one cached zone.
staticoffset(UTC,OffsetSeconds)offset(+types([integer,compound]),-integer) - one_or_errordaylight_saving_time/4
Returns true or false according to whether daylight saving time is active for a loaded zone and a UTC instant.
staticdaylight_saving_time(TZif,Zone,UTC,IsDST)daylight_saving_time(+compound,+atom,+types([integer,compound]),-atom) - zero_or_onedaylight_saving_time/3
Returns daylight-saving information for a zone in the cached TZif terms.
staticdaylight_saving_time(Zone,UTC,IsDST)daylight_saving_time(+atom,+types([integer,compound]),-atom) - one_or_errordaylight_saving_time/2
Cached single-zone convenience variant of daylight_saving_time/3 using the cached TZif terms; requires exactly one cached zone.
staticdaylight_saving_time(UTC,IsDST)daylight_saving_time(+types([integer,compound]),-atom) - one_or_errorabbreviation/4
Returns the time-zone abbreviation for a loaded zone and a UTC instant.
staticabbreviation(TZif,Zone,UTC,Abbreviation)abbreviation(+compound,+atom,+types([integer,compound]),-atom) - zero_or_oneabbreviation/3
Returns the time-zone abbreviation for a zone in the cached TZif terms.
staticabbreviation(Zone,UTC,Abbreviation)abbreviation(+atom,+types([integer,compound]),-atom) - one_or_errorabbreviation/2
Cached single-zone convenience variant of abbreviation/3 using the cached TZif terms; requires exactly one cached zone.
staticabbreviation(UTC,Abbreviation)abbreviation(+types([integer,compound]),-atom) - one_or_errorlocal_time_type/4
Returns the applicable local time type for a loaded zone and a local civil time given as a date_time/6 term. This strict variant fails unless the local civil time has a unique interpretation.
staticlocal_time_type(TZif,Zone,LocalDateTime,TimeType)local_time_type(+compound,+atom,+compound,-compound) - zero_or_onelocal_time_type/3
Returns the applicable local time type for a zone in the cached TZif terms. This strict variant fails unless the local civil time has a unique interpretation.
staticlocal_time_type(Zone,LocalDateTime,TimeType)local_time_type(+atom,+compound,-compound) - one_or_errorlocal_time_type/2
Cached single-zone convenience variant of strict local civil-time lookup; requires exactly one cached zone and fails unless the local civil time has a unique interpretation.
staticlocal_time_type(LocalDateTime,TimeType)local_time_type(+compound,-compound) - one_or_errorlocal_time_type_with_resolution/5
Returns the applicable local time type for a loaded zone and a local civil time using the explicit resolution mode: strict (fail unless exactly one interpretation exists), first (prefer the earliest valid interpretation), second (prefer the latest valid interpretation), and all (enumerate all valid interpretations in chronological order).
staticlocal_time_type_with_resolution(TZif,Zone,LocalDateTime,ResolutionMode,TimeType)local_time_type_with_resolution(+compound,+atom,+compound,+atom,-compound) - zero_or_morelocal_time_type_with_resolution/4
Returns the applicable local time type for a zone in the cached TZif terms using the explicit resolution mode: strict (fail unless exactly one interpretation exists), first (prefer the earliest valid interpretation), second (prefer the latest valid interpretation), and all (enumerate all valid interpretations in chronological order).
staticlocal_time_type_with_resolution(Zone,LocalDateTime,ResolutionMode,TimeType)local_time_type_with_resolution(+atom,+compound,+atom,-compound) - zero_or_morelocal_time_type_with_resolution/3
Cached single-zone convenience variant of local civil-time lookup using the explicit resolution mode: strict (fail unless exactly one interpretation exists), first (prefer the earliest valid interpretation), second (prefer the latest valid interpretation), and all (enumerate all valid interpretations in chronological order). Requires exactly one cached zone.
staticlocal_time_type_with_resolution(LocalDateTime,ResolutionMode,TimeType)local_time_type_with_resolution(+compound,+atom,-compound) - zero_or_morelocal_offset/4
Returns the UTC offset in seconds for a loaded zone and a local civil time. This strict variant fails unless the local civil time has a unique interpretation.
staticlocal_offset(TZif,Zone,LocalDateTime,OffsetSeconds)local_offset(+compound,+atom,+compound,-integer) - zero_or_onelocal_offset/3
Returns the UTC offset in seconds for a zone in the cached TZif terms. This strict variant fails unless the local civil time has a unique interpretation.
staticlocal_offset(Zone,LocalDateTime,OffsetSeconds)local_offset(+atom,+compound,-integer) - one_or_errorlocal_offset/2
Cached single-zone convenience variant of strict local civil-time offset lookup.
staticlocal_offset(LocalDateTime,OffsetSeconds)local_offset(+compound,-integer) - one_or_errorlocal_offset_with_resolution/5
Returns the UTC offset in seconds for a loaded zone and a local civil time using the explicit resolution mode: strict (fail unless exactly one interpretation exists), first (prefer the earliest valid interpretation), second (prefer the latest valid interpretation), and all (enumerate all valid interpretations in chronological order).
staticlocal_offset_with_resolution(TZif,Zone,LocalDateTime,ResolutionMode,OffsetSeconds)local_offset_with_resolution(+compound,+atom,+compound,+atom,-integer) - zero_or_morelocal_offset_with_resolution/4
Returns the UTC offset in seconds for a zone in the cached TZif terms using the explicit resolution mode: strict (fail unless exactly one interpretation exists), first (prefer the earliest valid interpretation), second (prefer the latest valid interpretation), and all (enumerate all valid interpretations in chronological order).
staticlocal_offset_with_resolution(Zone,LocalDateTime,ResolutionMode,OffsetSeconds)local_offset_with_resolution(+atom,+compound,+atom,-integer) - zero_or_morelocal_offset_with_resolution/3
Cached single-zone convenience variant of local civil-time offset lookup using the explicit resolution mode; requires exactly one cached zone.
staticlocal_offset_with_resolution(LocalDateTime,ResolutionMode,OffsetSeconds)local_offset_with_resolution(+compound,+atom,-integer) - zero_or_morelocal_daylight_saving_time/4
Returns daylight-saving information for a loaded zone and a local civil time. This strict variant fails unless the local civil time has a unique interpretation.
staticlocal_daylight_saving_time(TZif,Zone,LocalDateTime,IsDST)local_daylight_saving_time(+compound,+atom,+compound,-atom) - zero_or_onelocal_daylight_saving_time/3
Returns daylight-saving information for a zone in the cached TZif terms. This strict variant fails unless the local civil time has a unique interpretation.
staticlocal_daylight_saving_time(Zone,LocalDateTime,IsDST)local_daylight_saving_time(+atom,+compound,-atom) - one_or_errorlocal_daylight_saving_time/2
Cached single-zone convenience variant of strict local daylight-saving lookup.
staticlocal_daylight_saving_time(LocalDateTime,IsDST)local_daylight_saving_time(+compound,-atom) - one_or_errorlocal_daylight_saving_time_with_resolution/5
Returns daylight-saving information for a loaded zone and a local civil time using the explicit resolution mode: strict (fail unless exactly one interpretation exists), first (prefer the earliest valid interpretation), second (prefer the latest valid interpretation), and all (enumerate all valid interpretations in chronological order).
staticlocal_daylight_saving_time_with_resolution(TZif,Zone,LocalDateTime,ResolutionMode,IsDST)local_daylight_saving_time_with_resolution(+compound,+atom,+compound,+atom,-atom) - zero_or_morelocal_daylight_saving_time_with_resolution/4
Returns daylight-saving information for a zone in the cached TZif terms using the explicit resolution mode: strict (fail unless exactly one interpretation exists), first (prefer the earliest valid interpretation), second (prefer the latest valid interpretation), and all (enumerate all valid interpretations in chronological order).
staticlocal_daylight_saving_time_with_resolution(Zone,LocalDateTime,ResolutionMode,IsDST)local_daylight_saving_time_with_resolution(+atom,+compound,+atom,-atom) - zero_or_morelocal_daylight_saving_time_with_resolution/3
Cached single-zone convenience variant of local civil-time daylight-saving lookup using the explicit resolution mode; requires exactly one cached zone.
staticlocal_daylight_saving_time_with_resolution(LocalDateTime,ResolutionMode,IsDST)local_daylight_saving_time_with_resolution(+compound,+atom,-atom) - zero_or_morelocal_abbreviation/4
Returns the time-zone abbreviation for a loaded zone and a local civil time. This strict variant fails unless the local civil time has a unique interpretation.
staticlocal_abbreviation(TZif,Zone,LocalDateTime,Abbreviation)local_abbreviation(+compound,+atom,+compound,-atom) - zero_or_onelocal_abbreviation/3
Returns the time-zone abbreviation for a zone in the cached TZif terms. This strict variant fails unless the local civil time has a unique interpretation.
staticlocal_abbreviation(Zone,LocalDateTime,Abbreviation)local_abbreviation(+atom,+compound,-atom) - one_or_errorlocal_abbreviation/2
Cached single-zone convenience variant of strict local abbreviation lookup.
staticlocal_abbreviation(LocalDateTime,Abbreviation)local_abbreviation(+compound,-atom) - one_or_errorlocal_abbreviation_with_resolution/5
Returns the time-zone abbreviation for a loaded zone and a local civil time using the explicit resolution mode: strict (fail unless exactly one interpretation exists), first (prefer the earliest valid interpretation), second (prefer the latest valid interpretation), and all (enumerate all valid interpretations in chronological order).
staticlocal_abbreviation_with_resolution(TZif,Zone,LocalDateTime,ResolutionMode,Abbreviation)local_abbreviation_with_resolution(+compound,+atom,+compound,+atom,-atom) - zero_or_morelocal_abbreviation_with_resolution/4
Returns the time-zone abbreviation for a zone in the cached TZif terms using the explicit resolution mode: strict (fail unless exactly one interpretation exists), first (prefer the earliest valid interpretation), second (prefer the latest valid interpretation), and all (enumerate all valid interpretations in chronological order).
staticlocal_abbreviation_with_resolution(Zone,LocalDateTime,ResolutionMode,Abbreviation)local_abbreviation_with_resolution(+atom,+compound,+atom,-atom) - zero_or_morelocal_abbreviation_with_resolution/3
Cached single-zone convenience variant of local civil-time abbreviation lookup using the explicit resolution mode; requires exactly one cached zone.
staticlocal_abbreviation_with_resolution(LocalDateTime,ResolutionMode,Abbreviation)local_abbreviation_with_resolution(+compound,+atom,-atom) - zero_or_morelocal_time_type_reified/4
Returns a reified local civil-time lookup result for a loaded zone as one of unique(TimeType), ambiguous(TimeTypes), or nonexistent.
staticlocal_time_type_reified(TZif,Zone,LocalDateTime,Result)local_time_type_reified(+compound,+atom,+compound,-compound) - onelocal_time_type_reified/3
Returns a reified local civil-time lookup result for a zone in the cached TZif terms as one of unique(TimeType), ambiguous(TimeTypes), or nonexistent.
staticlocal_time_type_reified(Zone,LocalDateTime,Result)local_time_type_reified(+atom,+compound,-compound) - one_or_errorlocal_time_type_reified/2
Cached single-zone convenience variant of reified local civil-time lookup; returns unique(TimeType), ambiguous(TimeTypes), or nonexistent.
staticlocal_time_type_reified(LocalDateTime,Result)local_time_type_reified(+compound,-compound) - one_or_errorlocal_offset_reified/4
Returns a reified local offset lookup result for a loaded zone as one of unique(OffsetSeconds), ambiguous(OffsetSecondsList), or nonexistent.
staticlocal_offset_reified(TZif,Zone,LocalDateTime,Result)local_offset_reified(+compound,+atom,+compound,-compound) - onelocal_offset_reified/3
Returns a reified local offset lookup result for a zone in the cached TZif terms as one of unique(OffsetSeconds), ambiguous(OffsetSecondsList), or nonexistent.
staticlocal_offset_reified(Zone,LocalDateTime,Result)local_offset_reified(+atom,+compound,-compound) - one_or_errorlocal_offset_reified/2
Cached single-zone convenience variant of reified local offset lookup; returns unique(OffsetSeconds), ambiguous(OffsetSecondsList), or nonexistent.
staticlocal_offset_reified(LocalDateTime,Result)local_offset_reified(+compound,-compound) - one_or_errorlocal_daylight_saving_time_reified/4
Returns a reified local daylight-saving lookup result for a loaded zone as one of unique(IsDST), ambiguous(IsDSTList), or nonexistent.
staticlocal_daylight_saving_time_reified(TZif,Zone,LocalDateTime,Result)local_daylight_saving_time_reified(+compound,+atom,+compound,-compound) - onelocal_daylight_saving_time_reified/3
Returns a reified local daylight-saving lookup result for a zone in the cached TZif terms as one of unique(IsDST), ambiguous(IsDSTList), or nonexistent.
staticlocal_daylight_saving_time_reified(Zone,LocalDateTime,Result)local_daylight_saving_time_reified(+atom,+compound,-compound) - one_or_errorlocal_daylight_saving_time_reified/2
Cached single-zone convenience variant of reified local daylight-saving lookup; returns unique(IsDST), ambiguous(IsDSTList), or nonexistent.
staticlocal_daylight_saving_time_reified(LocalDateTime,Result)local_daylight_saving_time_reified(+compound,-compound) - one_or_errorlocal_abbreviation_reified/4
Returns a reified local abbreviation lookup result for a loaded zone as one of unique(Abbreviation), ambiguous(Abbreviations), or nonexistent.
staticlocal_abbreviation_reified(TZif,Zone,LocalDateTime,Result)local_abbreviation_reified(+compound,+atom,+compound,-compound) - onelocal_abbreviation_reified/3
Returns a reified local abbreviation lookup result for a zone in the cached TZif terms as one of unique(Abbreviation), ambiguous(Abbreviations), or nonexistent.
staticlocal_abbreviation_reified(Zone,LocalDateTime,Result)local_abbreviation_reified(+atom,+compound,-compound) - one_or_errorlocal_abbreviation_reified/2
Cached single-zone convenience variant of reified local abbreviation lookup; returns unique(Abbreviation), ambiguous(Abbreviations), or nonexistent.
staticlocal_abbreviation_reified(LocalDateTime,Result)local_abbreviation_reified(+compound,-compound) - one_or_errorProtected predicates
(none)
Private predicates
(none)
Operators
(none)