Edzelf / ESP32-Radio

Internet radio based on ESP32, VS1053 and a TFT screen.
GNU General Public License v3.0
965 stars 227 forks source link

Automatic DST change #398

Open BenSeventy9 opened 3 years ago

BenSeventy9 commented 3 years ago

New code for automatic DST time change:

Changes in ini_struct: String clk_server ; // Server to be used for time of day clock String clk_timezone ; // See https://remotemonitoringsystems.ca/time-zone-abbreviations.php for Timezone codes for your region

Data for ini_struct: ini_block.clk_server = "pool.ntp.org" ; // Default server for NTP ini_block.clk_timezone = "CET-1CEST-2,M3.5.0/02:00:00,M10.5.0/03:00:00" ; // See https://remotemonitoringsystems.ca/time-zone-abbreviations.php for Timezone codes for your region

configTime ( 0, 0, ini_block.clk_server.c_str() ) ; // GMT offset, daylight offset in seconds setenv("TZ", ini_block.clk_timezone.c_str(), ini_block.clk_offset) ; // See https://remotemonitoringsystems.ca/time-zone-abbreviations.php for Timezone codes for your region

That's all you need