354 if (rc == SNTP_SYNC_STATUS_COMPLETED) { |
354 if (rc == SNTP_SYNC_STATUS_COMPLETED) { |
355 time(&now); |
355 time(&now); |
356 localtime_r(&now, &timeinfo); |
356 localtime_r(&now, &timeinfo); |
357 System_TimeOk = true; |
357 System_TimeOk = true; |
358 strftime(strftime_buf, sizeof(strftime_buf), "%c", &timeinfo); |
358 strftime(strftime_buf, sizeof(strftime_buf), "%c", &timeinfo); |
359 ESP_LOGI(TAG, "NTP time is set: %s", strftime_buf); |
359 log_msg(TAG, "NTP time is set: %s", strftime_buf); |
360 } else { |
360 } else { |
361 ESP_LOGI(TAG, "NTP unknown time sync event rc=%d", rc); |
361 ESP_LOGI(TAG, "NTP unknown time sync event rc=%d", rc); |
362 } |
362 } |
363 } |
363 } |
364 |
364 |