Howdy! The daylight savings triggers are set in the
TZ environment variable, which your code sets in
NTP.ino at line 11, using the content of the
TZ_INFO macro, which is defined in
DFC77_ESP32.ino. This string follows the
POSIX TZ format to define the name of the timezone and its daylight savings counterpart, followed by a specification that tells the system when DST starts and ends.
In your case, you have the following spec:
AST4ADT,M3.5.0/02:00:00,M10.5.0/03:00:00This defines:
- A standard time timezone called AST that has an offset of 4 hours behind UTC. (that is, you have to add +4 hours to it in order to reach UTC)
- A daylight savings timezone called ADT that has no offset (which is therefore assumed to be 1 hour) from standard time
- Daylight savings starts at 2AM on the 0th day (Sunday) of the 5th week of the 3rd month of the year (March)
- Daylight savings ends at 3AM on the 0th day of the 5th week of the 10th month of the year (October)
I'm not sure when you switch where you are, but you can just make the necessary adjustments and it should work. For example, here in Ontario we switch at 2AM on the 2nd Sunday of March, and switch back at 2AM on the 1st Sunday of November, so our string looks like
EST5EDT,M3.2.0,M11.1.0. If you're in Atlantic time, yours is probably very similar, i.e.
AST4ADT,M3.2.0,M11.1.0Note that most UNIX systems also define a set of shorthand strings (such as
America/Toronto or
America/New_York) for convenience, but these aren't supported by the datetime system on the ESP32 (or, at least, they weren't the last time I checked).
—CC