AceTime  3.0.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...
 
int32_t stdOffsetSeconds = 0
 STD offset of the resulting OffsetDateTime.
 
int32_t dstOffsetSeconds = 0
 DST offset of the resulting OffsetDateTime.
 
int32_t reqStdOffsetSeconds = 0
 STD offset of the Transition which matched the epochSeconds requested by findByEpochSeconds(), or the LocalDateTime requested by findByLocalDateTime(). More...
 
int32_t reqDstOffsetSeconds = 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 23 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 115 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 76 of file ZoneProcessor.h.

◆ reqDstOffsetSeconds

int32_t ace_time::FindResult::reqDstOffsetSeconds = 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 dstOffsetSeconds when findByLocalDateTime() returns kTypeGap. For all other resulting types from findByEpochSeconds(), and for all resulting types from findByLocalDateTime(), the reqStdOffsetSeconds will be the same as dstOffsetSeconds.

Definition at line 108 of file ZoneProcessor.h.

◆ reqStdOffsetSeconds

int32_t ace_time::FindResult::reqStdOffsetSeconds = 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 stdOffsetSeconds when findByLocalDateTime() returns kTypeGap. For all other resulting types from findByEpochSeconds(), and for all resulting types from findByLocalDateTime(), the reqStdOffsetSeconds will be the same as stdOffsetSeconds.

Definition at line 95 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 reqStdOffsetSeconds and reqDstOffsetSeconds, and the later transition in stdOffsetSeconds and dstOffsetSeconds.
    • LocalDateTime::fold=1 returns the later transition in reqStdOffsetSeconds and reqDstOffsetSeconds, and the earlier transition in stdOffsetSeconds and dstOffsetSeconds.
  • 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 65 of file ZoneProcessor.h.


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