AceTime  0.8
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 Attributes | Static Public Attributes | List of all members
ace_time::basic::ZoneRule Struct Reference

A time zone transition rule. More...

#include <ZonePolicy.h>

Public Attributes

int8_t const fromYearTiny
 FROM year as an offset from year 2000 stored as a single byte. More...
 
int8_t const toYearTiny
 TO year as an offset from year 2000 stored as a single byte. More...
 
uint8_t const inMonth
 Determined by the IN column. More...
 
uint8_t const onDayOfWeek
 Determined by the ON column. More...
 
int8_t const onDayOfMonth
 Determined by the ON column. More...
 
uint8_t const atTimeCode
 Determined by the AT column in units of 15-minutes from 00:00. More...
 
uint8_t const atTimeModifier
 The atTimeModifier is a packed field containing 2 pieces of info: More...
 
int8_t const deltaCode
 Determined by the SAVE column, containing the offset from UTC, in 15-min increments. More...
 
uint8_t const letter
 Determined by the LETTER column. More...
 

Static Public Attributes

static const int8_t kMaxYearTiny = 126
 The maximum value of fromYearTiny and toYearTiny. More...
 

Detailed Description

A time zone transition rule.

It is useful to think of this as a transition rule that repeats on the given (month, day, hour) every year during the interval [fromYear, toYear] inclusive.

Definition at line 12 of file ZonePolicy.h.

Member Data Documentation

◆ atTimeCode

uint8_t const ace_time::basic::ZoneRule::atTimeCode

Determined by the AT column in units of 15-minutes from 00:00.

The range is (0 - 100) corresponding to 00:00 to 25:00.

Definition at line 50 of file ZonePolicy.h.

◆ atTimeModifier

uint8_t const ace_time::basic::ZoneRule::atTimeModifier

The atTimeModifier is a packed field containing 2 pieces of info:

  • The upper 4 bits represent the AT time suffix: 'w', 's' or 'u', represented by kSuffixW, kSuffixS and kSuffixU.
  • The lower 4 bits represent the remaining 0-14 minutes of the AT field after truncation into atTimeCode. In other words, the full AT field in one-minute resolution is (15 * atTimeCode + (atTimeModifier & 0x0f)).

Definition at line 61 of file ZonePolicy.h.

◆ deltaCode

int8_t const ace_time::basic::ZoneRule::deltaCode

Determined by the SAVE column, containing the offset from UTC, in 15-min increments.

If the '–scope extended' flag is given to tzcompiler.py, this field should be interpreted as an uint8_t field, whose lower 4-bits hold a slightly modified value of offsetCode equal to (originalDeltaCode + 4). This allows the 4-bits to represent DST offsets from -1:00 to 2:45 in 15-minute increments. This is the same algorithm used by ZoneEra::deltaCode field for consistency. The extended::ZonePolicyBroker::deltaMinutes() method knows how to convert this field into minutes.

Definition at line 76 of file ZonePolicy.h.

◆ fromYearTiny

int8_t const ace_time::basic::ZoneRule::fromYearTiny

FROM year as an offset from year 2000 stored as a single byte.

Definition at line 20 of file ZonePolicy.h.

◆ inMonth

uint8_t const ace_time::basic::ZoneRule::inMonth

Determined by the IN column.

1=Jan, 12=Dec.

Definition at line 26 of file ZonePolicy.h.

◆ kMaxYearTiny

const int8_t ace_time::basic::ZoneRule::kMaxYearTiny = 126
static

The maximum value of fromYearTiny and toYearTiny.

Must be < ZoneEra::kMaxUntilYear.

Definition at line 17 of file ZonePolicy.h.

◆ letter

uint8_t const ace_time::basic::ZoneRule::letter

Determined by the LETTER column.

Determines the substitution into the 's' field (implemented here by just a '') of the ZoneInfo::format field. Possible values are 'S', 'D', '-', or a number < 32 (i.e. a non-printable character). If the value is < 32, then this number is an index offset into the ZonePolicy.letters[] array which contains a (const char*) of the actual multi-character letter.

As of TZ DB version 2018i, there are 4 ZonePolicies which have ZoneRules with a LETTER field longer than 1 character:

  • Belize ('CST'; used by America/Belize)
  • Namibia ('WAT', 'CAT'; used by Africa/Windhoek)
  • StJohns ('DD'; used by America/St_Johns and America/Goose_Bay)
  • Troll ('+00' '+02'; used by Antarctica/Troll)

Definition at line 94 of file ZonePolicy.h.

◆ onDayOfMonth

int8_t const ace_time::basic::ZoneRule::onDayOfMonth

Determined by the ON column.

Used with onDayOfWeek. Possible values are: 0, 1-31, or its corresponding negative values.

Definition at line 44 of file ZonePolicy.h.

◆ onDayOfWeek

uint8_t const ace_time::basic::ZoneRule::onDayOfWeek

Determined by the ON column.

Possible values are: 0, 1=Mon, 7=Sun. There are 4 combinations:

* onDayOfWeek=0, onDayOfMonth=(1-31): exact match
* onDayOfWeek=1-7, onDayOfMonth=1-31: dayOfWeek>=dayOfMonth
* onDayOfWeek=1-7, onDayOfMonth=-(1-31): dayOfWeek<=dayOfMonth
* onDayOfWeek=1-7, onDayOfMonth=0: last{dayOfWeek}
* 

Definition at line 38 of file ZonePolicy.h.

◆ toYearTiny

int8_t const ace_time::basic::ZoneRule::toYearTiny

TO year as an offset from year 2000 stored as a single byte.

Definition at line 23 of file ZonePolicy.h.


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