diff --git a/main/ntp.cpp b/main/ntp.cpp
index 4e17359790bd86d82042ce12f6aef331bdf9d7e1..9b4faa93b90add8a2169d7a7b1d63359510f8796 100644
--- a/main/ntp.cpp
+++ b/main/ntp.cpp
@@ -24,7 +24,8 @@ static ntpd_parameter_t parameter;
 
 void ntp_task(void *ignored) {
     time_t now = 0;
-    struct tm timeinfo = { 0 };
+    struct tm timeinfo;
+    memset(&timeinfo, 0, sizeof(tm));
 
     ESP_LOGI(TAG, "Configuring ntp");
     sntp_setoperatingmode(SNTP_OPMODE_POLL);