AceTime  2.1.0
Date and time classes for Arduino that support timezones from the TZ Database.
Public Attributes | Static Public Attributes | List of all members
ace_time::FindResult Class Reference

Result of a search for transition at a specific epochSeconds or a specific LocalDateTime. More...

#include <ZoneProcessor.h>

Public Attributes

uint8_t type = kTypeNotFound
 Result of the findByEpochSeconds() or findByLocalDateTime() search methods. More...
 
uint8_t fold = 0
 For findByLocalDateTime(), when type==kTypeOverlap, this is a copy of the requested LocalDateTime::fold parameter. More...
 
int16_t stdOffsetMinutes = 0
 STD offset of the resulting OffsetDateTime.
 
int16_t dstOffsetMinutes = 0
 DST offset of the resulting OffsetDateTime.
 
int16_t reqStdOffsetMinutes = 0
 STD offset of the Transition which matched the epochSeconds requested by findByEpochSeconds(), or the LocalDateTime requested by findByLocalDateTime(). More...
 
int16_t reqDstOffsetMinutes = 0
 DST offset of the Transition which matched the epochSeconds requested by findByEpochSeconds(), or the LocalDateTime requested by findByLocalDateTime(). More...
 
const char * abbrev = ""
 Pointer to the abbreviation stored in the transient Transition::abbrev variable. More...
 

Static Public Attributes

static const uint8_t kTypeNotFound = 0
 
static const uint8_t kTypeExact = 1
 
static const uint8_t kTypeGap = 2
 
static const uint8_t kTypeOverlap = 3
 

Detailed Description

Result of a search for transition at a specific epochSeconds or a specific LocalDateTime.

More than one transition can match if the LocalDateTime occurs during an overlap (e.g. during a "fall back" from DST to STD).

Definition at line 25 of file ZoneProcessor.h.

Member Data Documentation

◆ abbrev

const char* ace_time::FindResult::abbrev = ""

Pointer to the abbreviation stored in the transient Transition::abbrev variable.

The calling code should copy the string into a local buffer quickly, before any other timezone calculations are performed.

Definition at line 117 of file ZoneProcessor.h.

◆ fold

uint8_t ace_time::FindResult::fold = 0

For findByLocalDateTime(), when type==kTypeOverlap, this is a copy of the requested LocalDateTime::fold parameter.

For all other resulting types, including kTypeGap, this will be set to 0.

For findByEpochSeconds(), when type==kTypeOverlap, this defines whether the corresponding LocalDateTime occurs the first time (0) or the second time (1). For all other resulting type, this will be set to 0.

Definition at line 78 of file ZoneProcessor.h.

◆ reqDstOffsetMinutes

int16_t ace_time::FindResult::reqDstOffsetMinutes = 0

DST offset of the Transition which matched the epochSeconds requested by findByEpochSeconds(), or the LocalDateTime requested by findByLocalDateTime().

This may be different than the dstOffsetMinutes when findByLocalDateTime() returns kTypeGap. For all other resulting types from findByEpochSeconds(), and for all resulting types from findByLocalDateTime(), the reqStdOffsetMinutes will be the same as dstOffsetMinutes.

Definition at line 110 of file ZoneProcessor.h.

◆ reqStdOffsetMinutes

int16_t ace_time::FindResult::reqStdOffsetMinutes = 0

STD offset of the Transition which matched the epochSeconds requested by findByEpochSeconds(), or the LocalDateTime requested by findByLocalDateTime().

This may be different than the stdOffsetMinutes when findByLocalDateTime() returns kTypeGap. For all other resulting types from findByEpochSeconds(), and for all resulting types from findByLocalDateTime(), the reqStdOffsetMinutes will be the same as stdOffsetMinutes.

Definition at line 97 of file ZoneProcessor.h.

◆ type

uint8_t ace_time::FindResult::type = kTypeNotFound

Result of the findByEpochSeconds() or findByLocalDateTime() search methods.

There are 2 slightly different cases:

Case 1: findByLocalDateTime()

  • kTypeNotFound:
    • No matching Transition found.
  • kTypeExact:
    • A single Transition found.
  • kTypeGap:
    • LocalDateTime occurs in a gap.
    • LocalDateTime::fold=0 returns the earlier transition in reqStdOffsetMinutes and reqDstOffsetMinutes, and the later transition in stdOffsetMinutes and dstOffsetMinutes.
    • LocalDateTime::fold=1 returns the later transition in reqStdOffsetMinutes and reqDstOffsetMinutes, and the earlier transition in stdOffsetMinutes and dstOffsetMinutes.
  • kTypeOverlap:

Case 2: findByEpochSeconds()

  • kTypeNotFound:
    • If no matching Transition found.
  • kTypeExact:
    • Only a single Transition found.
  • kTypeGap:
    • Cannot occur.
  • kTypeOverlap:
    • A single Transition found, but the epochSeconds occurs during an overlap where two local times can occur.
    • The fold parameter contains 0 or 1 to indicate the earlier or later resulting OffsetDateTime.

Definition at line 67 of file ZoneProcessor.h.


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