AceTime  0.5
Date and time classes for Arduino that support timezones from the TZ Database, and a system clock that can synchronize from an NTP server or an RTC chip.
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ace_time::basic::Transition Struct Reference

Data structure that defines the start of a specific UTC offset as described by the matching ZoneEra and its ZoneRule for a given year. More...

#include <BasicZoneProcessor.h>

Collaboration diagram for ace_time::basic::Transition:
Collaboration graph
[legend]

Public Member Functions

void log () const
 Used only for debugging. More...
 

Public Attributes

ZoneEraBroker era
 The ZoneEra that matched the given year. More...
 
ZoneRuleBroker rule
 The Zone transition rule that matched for the the given year. More...
 
int8_t yearTiny
 Year which applies to the ZoneEra or ZoneRule. More...
 
acetime_t startEpochSeconds
 The calculated transition time of the given rule. More...
 
int8_t offsetCode
 The total effective UTC offsetCode at the start of transition, including DST offset. More...
 
int8_t deltaCode
 The delta offsetCode from "standard time" at the start of transition.
 
char abbrev [kAbbrevSize]
 The calculated effective time zone abbreviation, e.g. More...
 

Static Public Attributes

static const uint8_t kAbbrevSize = 6 + 1
 Longest abbreviation currently seems to be 5 characters (https://www.timeanddate.com/time/zones/) but the TZ database spec says that abbreviations are 3 to 6 characters (https://data.iana.org/time-zones/theory.html#abbreviations), so use 6 as the maximum.
 

Detailed Description

Data structure that defines the start of a specific UTC offset as described by the matching ZoneEra and its ZoneRule for a given year.

If the ZoneEra does not have a ZoneRule, then the Transition is defined by the start date of the ZoneEra.

The 'era' and 'rule' variables intermediate values calculated during the init() phase. They are used to calculate the 'yearTiny', 'startEpochSeconds', 'offsetCode', 'deltaCode', and 'abbrev' parameters which are used during findMatch() lookup. NOTE: This separation may help move the ZoneInfo and ZonePolicy data structures into PROGMEM.

Definition at line 47 of file BasicZoneProcessor.h.

Member Function Documentation

◆ log()

void ace_time::basic::Transition::log ( ) const
inline

Used only for debugging.

Definition at line 102 of file BasicZoneProcessor.h.

Member Data Documentation

◆ abbrev

char ace_time::basic::Transition::abbrev[kAbbrevSize]

The calculated effective time zone abbreviation, e.g.

"PST" or "PDT". When the Transition is initially created using createTransition(), abbrev[0] is set to ZoneRule.letter (to avoid potentially another lookup in PROGMEM). That 'letter' is used later in the init() to generate the correct abbreviation which will replace the 'letter' in here.

Definition at line 99 of file BasicZoneProcessor.h.

◆ era

ZoneEraBroker ace_time::basic::Transition::era

The ZoneEra that matched the given year.

NonNullable.

This field is used only during the init() phase, not during the findMatch() phase.

Definition at line 62 of file BasicZoneProcessor.h.

◆ offsetCode

int8_t ace_time::basic::Transition::offsetCode

The total effective UTC offsetCode at the start of transition, including DST offset.

(Maybe rename this effectiveOffsetCode?) The DST offset is stored at deltaCode.

Definition at line 87 of file BasicZoneProcessor.h.

◆ rule

ZoneRuleBroker ace_time::basic::Transition::rule

The Zone transition rule that matched for the the given year.

Set to nullptr if the RULES column is '-'. We do not support a RULES column that contains a UTC offset. There are only 2 time zones that has this property as of TZ database version 2018g: Europe/Istanbul and America/Argentina/San_Luis.

This field is used only during the init() phase, not during the findMatch() phase.

Definition at line 74 of file BasicZoneProcessor.h.

◆ startEpochSeconds

acetime_t ace_time::basic::Transition::startEpochSeconds

The calculated transition time of the given rule.

Definition at line 80 of file BasicZoneProcessor.h.

◆ yearTiny

int8_t ace_time::basic::Transition::yearTiny

Year which applies to the ZoneEra or ZoneRule.

Definition at line 77 of file BasicZoneProcessor.h.


The documentation for this struct was generated from the following file: