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 about 3 years ago
make -C examples/MemoryBenchmark epoxy
to GitHub actions.Published by bxparks about 3 years ago
ace_time::clock
andace_time::hw
to the new#include <AceTimeClock.h>
.DS3231.h
into a template class with an<AceWire.h>
, replacing direct dependency on<Wire.h>
.
<Wire.h>
header causes flash memory to beWire
object is never used.BasicZoneManager
and ExtendedZoneManager
into new BasicLinkManager
ExtendedLinkManager
.
ZoneManager
.docs/installation.md
into README.md.docs/date_time_timezone.md
to USER_GUIDE.md
.docs/clock_system_clock.md
after migrating it todocs/comparisons.md
into README.md.Published by bxparks about 3 years ago
ExtendedZoneProcessor.h
to implement betterZoneEra
.
ExtendedZoneProcessor.h
should now be identicalzone_processor.py
in the AceTimePython
library.Europe/Lisbon
in 1992, which is not a part ofzonedb
or zonedbx
database, which normally includeace_time/testing/ExtendedTransitionTest.h
to validateExtendedZoneProcessor
and thezone_processor.py
ofAceTimePython
library.examples/DebugZoneProcessor
for debugging the internal logicExtendedZoneProcessor
.Africa/Accra -> Africa/Abidjan
America/Atikokan -> America/Panama
America/Blanc-Sablon -> America/Puerto_Rico
America/Creston -> America/Phoenix
America/Curacao -> America/Puerto_Rico
America/Nassau -> America/Toronto
America/Port_of_Spain -> America/Puerto_Rico
Antarctica/DumontDUrville -> Pacific/Port_Moresby
Antarctica/Syowa -> Asia/Riyadh
Pacific/Enderbury -> Pacific/Kanton
Pacific/Kanton
zonedb
databasezonedbx
databasePublished by bxparks about 3 years ago
./tools
directory into new./tests/validation
directory into new.github/workflows/validation.yml
to use AceTimeValidation./tests/validation
.Published by bxparks about 3 years ago
docs/*.md
in an earlierDS3231Module
class that uses AceWire
library.Published by bxparks over 3 years ago
ZonedDateTime::normalize()
, which must be called byZonedDateTime
mutation function.
PrintStr::getCstr()
in AceCommon <=1.4.4 to the shorterPrintStr::cstr()
in AceCommon >= 1.4.5.AceRoutine::coroutineMillis()
into non-virtual.SystemClock
to instantiate from SystemClockTemplate
, whichSystemClock::clockMillis()
to also become non-virtual. SavesPublished by bxparks over 3 years ago
SystemClock::getSecondsSinceSyncAttempt()
SystemClock::getSecondsToSyncAttempt()
, which substantiallySystemClockLoop
andSystemClockCoroutine
.tests/auniter.ini
to be consistent with my other libraries. Addenv:teensy32
(which had been supported for a while) andenv:mkr1000
(which I just received).Published by bxparks over 3 years ago
tools/compare_noda
to compare Noda Time against AceTime.
--nzd_file
flag to compare_noda
to allow custom NodaZoneDataTzdbCompiler
manually to generate customtzdata$(TZ_VERSION).nzd
for the specific TZDB version specified intests/validation/BasicNodaTest
which matches AceTime completelytests/validation/ExtendedNodaTest
which maches AceTimeBasicHinnantDateTest
andExtendedHinnantDateTest
.ace_time::clock::Stm32F1Clock
and ace_time::hw::Stm32F1Rtc
LSE_CLOCK
(low speed external clock).
ace_time::clock::StmRtcClock
class, which usesSTM32RTC
library, which does not fully work on theSTM32RTC
forgets the date fields upon power reset, preservingUSER_GUIDE.md
and README.md
for clarity
USER_GUIDE.md
into separate docs,USER_GUIDE.md
shorter and hopefully more digestable.USER_GUIDE.md
into docs/date_time_timezone.md
.Clock
classes into docs/clock_system_clock.md
docs/installation.md
.docs/validation.md
.docs/comparisons.md
.StmRtcClock
and Stm32F1Clock
.ace_time::clock::Clock
class.
acetz.py
.
fold
.BasicAcetzTest
and ExtendedAcetzTest
and verify all zonesprintShortNameTo()
and printShortTo()
methods now printSystemClock
SystemClock::forceSync()
that crashes if the referenceClock isSystemClock
.
getSecondsSinceSyncAttempt()
getSecondsToSyncAttempt()
getSyncStatusCode()
SystemClockLoop
and SystemClockCoroutine
to private
.
kStatusReady
, kStatusSent,
kStatusOk`kSystemClock
is now exposed throughNtpClock
analogRead()
too often (e.g. using buttonsPublished by bxparks over 3 years ago
TimeZone::kTypeBasicManaged
and TimeZone::kTypeExtendedManaged
TimeZone::kTypeBasic
andTimeZone::kTypeExtended
.
TimeZone
.TimeZone
no longer holds a reference to a ZoneProcessorCache
, itZoneProcessor
.TimeZone
to its BasicZoneProcessor
orExtendedZoneProcessor
now happens early, inside theBasicZoneManager
or the ExtendedZoneManager
, instead of delayingTimeZone
through theZoneProcessorCache
.BasicZoneProcessor
intoBasicZoneProcessorTemplate
, and ExtendedZoneProcessor
toExtendedZoneProcessorTemplate
.ZoneEra
anchor record which preventedconst ZoneInfo*
, replacing it withuintptr_t zoneKey
.BrokerFactory
indirection layer to provide mapping from auintptr_t zoneKey
to the corresponding ZoneInfoBroker
.Zone*Broker
classes.ZoneProcessor
binding to TimeZone
.
nullptr
could crash the program ifTimeZone::toTimeZoneData() was called immediately after calling the
TimeZone::forZoneInfo()` factory method.TimeZone
(getZoneId()
, printTo()
,printShortTo()
) could return incorrect values if the number ofSIZE
template parameter given to the ZoneManager
.
ZoneProcessorCache
will rebindZoneProcessor
to another TimeZone
whenZoneRegistrar.h
into internal/
.
BasicZoneRegistrar
to basic::ZoneRegistrar
.ExtendedZoneRegistrar
to extended::ZoneRegistrar
.BasicZoneManager
and ExtendedZoneManager
. It was not exposed tolinkRegistry[]
parameter inBasicZoneManager
and ExtendedZoneManager
.
zonedb/zone_registry.h
and zonedbx/zone_registry.h
fileskLinkRegistrySize
and a LinkEntry kLinkRegistry[]
linkId
to itszoneId
.ZoneManager::createForZoneId()
method will search the Thin LinkzoneId
is not found in the Zone registry.ZoneManager::registrySize()
tozoneRegistrySize()
.
ZoneManager::linkRegistrySize()
method.ZoneManager
can now hold 2 different registries: the Zone (and FatPublished by bxparks almost 4 years ago
ZoneManager::createForZoneName()
andZoneManager::createForZoneId()
.
zone_registry.cpp
was sorted by zoneName, so onlycreateForZoneName()
could use the binary search. The newzone_registry.cpp
entries by zoneId
instead ofzoneName
. The createForZoneId()
can use the binary searchcreateForZoneName()
can also use the binary search becausezoneName
is converted dynamically to its zoneId
using the sametzcompiler.py
. If there is a match,zoneName
is performed to makeAutoBenchmark.ino
to determine that a binary search on thezonedb/zone_registry.cpp
is 9-10X faster (on average)ZoneEra
records.kZoneAndLinkRegistry[]
array in zone_registry.h
that containsUSER_GUIDE.md
.ace_common::KString
.
zonedb
info files, andzonedbx
info files.transitionBufSize
fromZoneInfo
struct, and migrate to kZoneBufSize{xxx}
constants in thezone_infos.h
files.
tests/validation
andExtended{xxx}
tests. Saves 1 byte per Zone on 8-bitBasicZone::name()
and shortName()
printNameTo()
and printShortNameTo()
. Same withExtendedZone::name()
and shortName()
, replaced with printNameTo()
printShortNameTo()
.
name
and shortName
without usingBasicZone
and ExtendedZone
BasicZone::printNameTo(Print&)
,BasicZone::printShortNameTo(Print&)
(similarly for ExtendedZone
)ace_common::PrintStr<>
object, then extract thePrintStr::getCstr()
.arduino:samd
Core >= 1.8.10.
Published by bxparks almost 4 years ago
src/ace_time/zonedb
and src/ace_time/zonedbx
Published by bxparks almost 4 years ago
ManualZoneManager
inTimePeriod
error object.
kMaxPeriodSeconds
and kInvalidPeriodSeconds
constants.forError()
factory method.toSeconds()
and TimePeriod(seconds)
<Invalid TimePeriod>
.ace_time::clock::StmRtcClock
class.
TimeZone
objects.TimeOffset
objects:
TimeZone::forHours()
TimeZone::forMinutes()
TimeZone::forHourMinute()
kTypeXxx
constants in ZoneManager.h
. Fortunately, theUSER_GUIDE.md
zonedb
and zonedbx
databases:
zonedb::kTzDatabaseVersion
zonedb::kZoneContext.startYear
zonedb::kZoneContext.untilYear
zonedbx::kTzDatabaseVersion
zonedbx::kZoneContext.startYear
zonedbx::kZoneContext.untilYear
ZonedDateTime
must always be withinstartYear
and untilYear
. An error object will be returned outsideexamples/AutoBenchmark
to allow auto-generation of ASCII tables,README.md
file. Update CPUtools
refactoring
%
string formatting to f-strings.data_types/at_types.py
.data_types/at_types.py
.artransformer.py
.at_time_modifier
,ntil_time_modifier
) into artransformer.py
instead of theargenerator.py
.zonedb.json
or zonedbx.json
) files.argenerator.py
use only the JSON output instead of makingLettersMap
and LettersPerPolicy
in the JSON file.CommentsCollection
into CommentsMap
using an Iterable
Dict[str, Iterable[str]]
.TransformerResult
.generate_data.*
or sometest_xxx.py
.--input_dir
flag to generate_data.cpp
to allow the TZ database--ignore_buf_size_too_big
to workaround a mismatch betweenbufestimator.py
ExtendedZoneProcessor.cpp
.--skip_checkout
flag to tzcompiler.py
to allow local--delta_granularity
flag to transformer.py
to decouple it--offset_granularity
, so that the SAVE
and RULES
STDOFF
--until_at_granularity
continues to control AT
UNTIL
.zinfo.py --debug
to be more readable.--generate_zone_strings
from tzcompiler.py
which removeszone_strings.{h,cpp}
. The storage andzonedbpy
database from the default[2000,2050)
to [1974, 2050)
to allow zinfo.py
to handle a larger--action
and --language
flags for tzcompiler.py
; only--language
flag needed right now.RulesMap
to PoliciesMap
, rules_map
to policies_map
,rule_name
to policy_name
etc. For consistency with ZonesMap
,zones_map
, and zone_name
.ZoneId
hashes to JSON output files.Published by bxparks almost 4 years ago
ZoneManager
interface (pure virtual) which is now theBasicZoneManager
andExtendedZoneManager
. Allows ZoneManager
to be passed aroundZoneManager::indexForZoneName()
andZoneManager::indexForZoneId()
caused by incorrect implementations inBasicZoneRegistrar
and ExtendedZoneRegistrar
.zonedb::kZoneId{Zone_Name}
and zonedbx::kZoneId{Zone_Name}
(e.g.zonedb::kZoneIdAmerica_Los_Angeles
). Can be given directly toZoneManager::createForZoneId()
.TimeZoneData
to allow initializers to setTimeZoneData
.ManualZoneManager
implementation of ZoneManager
which implementscreateForTimeZoneData()
. Useful in applications which support onlyTimeZone::kTypeManual
(fixed std and dst offsets) due to memoryTimeZoneData
, TimeZone::toTimeZoneData()
, andZoneManager::createFromTimeZoneData()
to USER_GUIDE.md
. Looks like ILocalDateTime::compareTo()
using only its components insteadLocalDateTime
can becompareTo()
methods of LocalDateTime
,LocalTime
, LocalDate
, OffsetDateTime
and ZonedDateTime
to clarifyPublished by bxparks almost 4 years ago
examples/MemoryBenchmark
numbers from v0.8 to v1.2 withUSER_GUIDE.md
to help navigate the longPublished by bxparks almost 4 years ago
depends
attribute to library.properties
.class TimingStats
incrementMod()
, incrementModOffset()
, printPad2To()
,printPad3To()
strcmp_PP()
strchr_P()
, strrchr_P()
for ESP8266 and ESP32PrintStr
common/CrcEeprom.h
to AceUtilsPublished by bxparks about 4 years ago
src/ace_time/zonedb
and src/ace_time/zonedbx
to TZDB 2020dPublished by bxparks about 4 years ago
PrintStr<N>
class from the AceUtilsprintTo()
PrintStr::getCstr()
method which returns a normal const char*
PrintStr<N>
class replaces an earlier, unreleased versionCstrPrint<N>
.tests/validation/*Test
.blacklist.json
file for each compare_xxx
tools, to disableValidationScope
enum to provide better control over whether thetests/validation
fails inBasicTransitionTest
and ExtendedTransitionTest
classes.DEVELOPER.md
file containing notes mostly for myself.Published by bxparks over 4 years ago
README.md
.USER_GUIDE.md
and update its version number to 1.0 as it./tools
processing pipeline and updatevalidation/tests
.
tools
.validation*.{h,cpp}
code generation through a single programvalidation_data.json
intermediate file.transformer.py
into a singletzdbcollector.py
which can produce a tzdb.json
output.validator.py
processing into a distinct section.dateutil
library (similar topytz
).Published by bxparks about 5 years ago
examples/HelloNtpClock/
to demonstrate this. (#24, thanksFPSTR()
macro for ESP32 Corevalidation/*Test
integrationsrc/ace_time/zonedb[x]
. This allows us to match the version of the TZsrc/ace_time/zonedb[x]
.src/ace_time/zonedb[x]
files to TZ version 2019c.Published by bxparks about 5 years ago
SystemClockCoroutine
to be compatible withCOROUTINE_DELAY_SECONDS()
API changed in AceRoutine v0.3.USER_GUIDE.md
and README.md
.YearMonth
abstraction in BasicZoneProcessor
, saving 12 bytes