Date and time classes for Arduino supporting the IANA TZ Database time zones to convert epoch seconds to date and time components in different time zones.
MIT License
Published by bxparks over 1 year ago
Major Changes in v2.3: Add CompleteZoneProcessor
, CompleteZoneManager
,
and the zonedbc
database to support all timezones, for all transitions defined
in the IANA TZ database ([1844,2087])
, and extending the validity of timezone
calculations from [2000,10000)
to [0001,10000)
.
Migration: MIGRATING.md
Changelog
BasicZoneManager
to detect gaps.
AceTimeValidation/validation
tests to pass.ZoneRule.letter
in BasicZoneProcessor
.
zonedb
which enables 2 more zones: /Africa/Windhoek
,America/Belize
zonedb
by 150-200 bytes.BrokerFactory
to ZoneInfoStore
for better self-documentation.
ZoneContext
ZoneContext
, letters[]
, fragments[]
into PROGMEM.zonedbXxx::kTzDatabaseVersion
string into PROGMEM, and changeconst __FlashString*
.ZoneContextBroker
around ZoneContext
, for consistencyZoneContext.h
intoZoneInfo.h
.startYearAccurate
and untilYearAccurate
to ZoneContext
whichzoneinfolow
,zoneinfomid
, zoneinfohigh
, supporting low, middle, and high timezoneinfohigh
was created to support CompleteZoneProcessor
,CompleteZoneManager
and the zonedbc
database.zoneinfomid
initially used in ExtendedZoneProcessor
, but nowzoneinfo/ZonePolicy.h
into zoneinfo/ZoneInfo.h
.zoneinfo/ZoneInfo.inc
into templates, withtypename S
selector. Merge ZoneInfo.inc
intoZoneInfo.h
.CompleteZoneManager
,CompleteZoneProcessor
, and zonedbc
database
int16_t
to int32_t
.TimeOffset
to support one-second resolution using int32_t
.BasicZone::stdOffseMinutes()
to BasicZone::stdOffset()
TimeOffset
object.ExtendedZone::stdOffseMinutes()
toExtendedZone::stdOffset()
which returns a TimeOffset
object.BasicZoneProcessor
using one-minute resolution because itsint16_t
to int32_t
CompleteZoneManager
, CompleteZoneProcessor
,CompleteZoneProcessorCache
, CompleteZone
zonedbc
database which is valid from [1800,10000)
, whichscope=complete
to access the zonedbc
database.ZoneContext.startYear()
andZoneContext.untilYear()
LocalDate::kMinYear
and LocalDate::kMaxYear
, mostlyint16_t
range.startYearAccurate()
anduntilYearAccurate()
limits.startYearAccureate()
and untilYearAccurate()
allowsZonedDateTime
for yearssrc/tzonedb*
directories
src/zonedb*testing
for consistency with other acetime librariesPublished by bxparks over 1 year ago
ace_time/testing/*
classes to support splitting the test datatransitions
and samples
.
validation_data.json
from AceTimeValidation.AceTimeValidation
test names to tests/Xxx{Basic,Extended}Test
.ZonedExtra::kAbbrevSize
to define the char
buffer size needed toZonedExtra::kInvalidMinutes
from public to private.
ZonedExtra::isError()
instead.Epoch::currentEpochYear()
is modified.ZoneProcessor::resetTransitionCache()
ZoneProcessorCache::resetZoneProcessors()
ZoneManager::resetZoneProcessors()
daysToCurrentEpochFromConverterEpoch()
todaysToCurrentEpochFromInternalEpoch()
.Published by bxparks over 1 year ago
Published by bxparks over 1 year ago
zonedb*
files to 2023b.TimeZone::forMinutes()
from uint8_t
touint16_t
.TimeZone
effectively immutable, by removing setStdOffset()
setDstOffset()
methods.TimeZone
object usingTimeZone::forTimeOffset(std, dst)
and overwrite the old one.zoneino/compat.h
to clobber the broken definitionFPSTR()
in Seeeduino 1.8.3.Rule.LETTER
.
ZoneContext.letters
array, notLETTER
which are only a single character.BasicZoneProcessor
by ~200 bytes when 1-2 zones areExtendedZoneProcessor
for 1-2 zones. But decreasesbasic::ZoneRule.deltaCode
,basic::ZoneEra.deltaCode
, and basic::ZoneEra.offsetCode
to beextended::ZoneXxx
.BasicBrokers.h
and ExtendedBrokers.h
into just Brokers.h
.ace_time/internal/testing/tzonedb[x]
database filesace_time/tzonedb[x]
.ace_time/zonedb[x]
database files to ace_time/zonedb[x]
.ace_time/internal/Zone*.h
files into new src/zoneinfo/
*zonedb*
ZonedDateTime::offsetDateTime()
OffsetDateTime
inside the ZonedDateTime
.ZonedDateTime::localDateTime()
.ExtendedZoneProcessor
to work over all years [0,10000)
[2000,2100)
).[2000,2100)
.Published by bxparks over 1 year ago
ZonedExtra
ZonedExtra::forComponents()
factory method, for consistency withZonedDateTime
class.examples/AutoBenchmark
ZonedExtra
benchmarks.README.md
AceTimeValidation
validation years to [2000,2100)
.Published by bxparks over 1 year ago
kPolicyXxx
to kZonePolicyXxx
for consistency. These areTimeZone.h
TimeZone
with a newZonedExtra
classTimeZone::getUtcOffset()
ZonedExtra::timeOffset()
TimeZone::getDeltaOffset()
ZonedExtra::dstOffset()
TimeZone::getAbbrev()
ZonedExtra::abbrev()
ZonedExtra::abbrev()
returns pointer to a local string bufferTransition
object.TimeZone
becomes closer to being thread-safeZonedExtra.h
ZonedExtra::forEpochSeconds(epochSeconds, tz)
ZonedExtra::forLocalDateTime(ldt, tz)
TimeZone
class simplified
followLink
flag on various methods.isLink()
andprintTargetNameTo()
.ZoneProcessor.h
, ExtendedZoneProcessor.h
, BasicZoneProcessor.h
getUtcOffset()
, getDeltaOffset()
, getAbbrev()
findByLocalDateTime()
, findByEpochSeconds()
testing/tzonedb/
and testing/tzonedbx/
.
Published by bxparks almost 2 years ago
ExtendedZoneProcssor::generateStartUntilTimes()
fromzonedbx
is accidentally corrupted (e.g. by usingint8
year fields instead of int16
year fields).zone_policies.h
comments into notablezone_infos.h
.Published by bxparks almost 2 years ago
year
component from int8_t
toint16_t
, extending the range of valid years from [-1873,2127] toyearTiny()
getters and setters from LocalDate
,LocalDateTime
, OffsetDateTime
, and ZonedDateTime
.
LocalDate
:
kInvalidYearTiny
, replaced with kInvalidYear
kMinYearTiny
, replaced with kMinYear
kMaxYearTiny
, replaced with kMaxYear
forTinyComponents()
LocalDateTime
forTinyComponents()
src/zonedb
and src/zonedbx
using int16_t
year types.untilYear
of zonedb and[2000,10000)
zonedbx
adds 75 additional Rules for kPolicyMorocco
(e.g.zonedb
remains unchangedEpochConverterJulian
and EpochConverterHinnant
EpochConverterJulian
implements the algorithms found inEpochConverterHinnant
implements the algorithms found inLocalDate
to use the EpochConverterHinnant
instead ofEpochConverterJulian
.
EpochConverterHinnant
.EpochConverterJulian
.Epoch
utility class
Epoch::currentEpochYear()
which allows customization of theEpoch::epochValidYearLower()
and Epoch::epochValidYearUpper()
currentEpochYear()
where the epoch seconds and time zonecurrentEpochYear()
is changed at runtime.
ZoneProcessor::resetTransitionCache()
ZoneProcessorCache::resetZoneProcessors()
ZoneManager::resetZoneProcessors()
toUnixSeconds()
and forUnixSeconds()
which use the 32-bittoUnixSeconds64()
and forUnixSeconds64()
arezonedb
increases ~1.5 kiBzonedbx
increases ~3 kiBzonedb
increases ~300 byteszonedbx
increases ~1.5 kiBPublished by bxparks almost 2 years ago
Published by bxparks about 2 years ago
Published by bxparks about 2 years ago
Published by bxparks about 2 years ago
ace_time::daysUntil(localDate, month, day)
utility function thatPublished by bxparks over 2 years ago
Published by bxparks over 2 years ago
BasicZoneProcessor
andExtendedZoneProcessor
.
BrokerFactory
properly.BrokerFactory
atnullptr
initially. ThesetBrokerFactory()
is expected to be called at runtime later.Published by bxparks over 2 years ago
ZoneInfoBroker::targetZoneInfo()
to return a ZoneInfoBroker
ZoneInfo*
pointer.
ZoneInfoBroker
classes to implement a consistentPublished by bxparks over 2 years ago
zonedb/
and zonedbx/
using latest AceTimeTool whichTimePeriod
.
isError()
returns true
, the sign()
method discriminatesprintTo()
prints the following:
TimeZone::isLink()
and ZoneProcessor::isLink()
methods.bool followLink = true
parameter to various other methodsgetZoneId()
, printTo()
, printShortTo()
) which determineszonedb/
and zonedbx
to convert Link entries fromoffset_date_time_mutation
methods.
zoned_date_time_mutation
methods.OffsetDateTime
.Published by bxparks almost 3 years ago
ZoneSorterByName
andZoneSorterByOffsetAndName
.
TransitionStorage::findTransition()
tofindTransitionForSeconds()
for better self-documentation.fold
parameter to control behavior around DST gapsfold
parameter is intended to be identical toLocalTime::fold()
, LocalDateTime::fold()
,OffsetDateTime::fold()
, ZonedDateTime::fold()
.ExtendedZoneProcessor::getOffsetDateTime(acetime_t)
toOffsetDateTime::fold()
as an output parameter.ExtendedZoneProcessor::getOffsetDateTime(const LocalDateTime&)
to handle LocalDateTime::fold()
as an inputExtendedZoneProcessor
by around 600 bytestoUnixSeconds64()
and forUnixSeconds64()
methods toLocalDate
, LocalDateTime
, OffsetDateTime
, ZonedDateTime
.
int64_t
integers, which allows Unix seconds to beacetime_t
).time_t
typedefint64_t
on the ESP8266 and ESP32 platforms.Published by bxparks almost 3 years ago
ZoneSorterByName
and ZoneSorterByOffsetAndName
classesUSER_GUIDE.md
.examples/CompareAceTimeToHinnantDate
to compare the performance ofMaxBufSize
comment field into zonedb[x]/zone_infos.h
which is theExtendedZoneProcessor::kMaxTransitions
.class TransitionStorage
getHighWater()
to getAllocSize()
. This now returns thegetHighWater() + 1
.resetHighWater()
to resetAllocSize()
.ExtendedZoneProcessor::resetTransitionHighWater()
toresetTransitionAllocSize()
.AceTimePython/zone_processor.ZoneProcessor
.BasicZoneProcessorCache
andExtendedZoneProcessorCache
out of BasicZoneManager
andExtendedZoneManager
. Remove all pure virtual
methods fromZoneManager
, making the class hierarchy non-polymorphic.
virtual
methods from LinkManager
,ZoneManager
.
Published by bxparks almost 3 years ago