This commit is contained in:
Micky 2023-02-14 09:48:04 +08:00
commit d70a9490cd
2 changed files with 6 additions and 1 deletions

View File

@ -384,6 +384,9 @@ void timeavailable(struct timeval *t) {
}
void setTimezone() {
#ifdef CUSTOM_TIMEZONE
String timezone = CUSTOM_TIMEZONE;
#else
const char *rootCACertificate = "-----BEGIN CERTIFICATE-----\n"
"MIIDzTCCArWgAwIBAgIQCjeHZF5ftIwiTv0b7RQMPDANBgkqhkiG9w0BAQsFADBa\n"
"MQswCQYDVQQGEwJJRTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJl\n"
@ -431,7 +434,7 @@ void setTimezone() {
}
delete client;
}
#endif
for (uint32_t i = 0; i < sizeof(zones); i++) {
if (timezone == "none") {
timezone = "CST-8";

View File

@ -12,6 +12,8 @@
#define NTP_SERVER2 "time.nist.gov"
#define GMT_OFFSET_SEC 0
#define DAY_LIGHT_OFFSET_SEC 0
// if CUSTOM_TIMEZONE is not defined then TIMEZONE API used based on IP, check zones.h
// #define CUSTOM_TIMEZONE "Europe/London"
/* Automatically update local time */
#define GET_TIMEZONE_API "https://ipapi.co/timezone/"