mirror of
https://github.com/esphome/esphome.git
synced 2024-12-19 16:07:47 +01:00
Prettier date time display after time sync (#2778)
This commit is contained in:
parent
897277992b
commit
3e5331a263
@ -71,7 +71,7 @@ void SNTPComponent::loop() {
|
|||||||
if (!time.is_valid())
|
if (!time.is_valid())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ESP_LOGD(TAG, "Synchronized time: %d-%d-%d %d:%02d:%02d", time.year, time.month, time.day_of_month, time.hour,
|
ESP_LOGD(TAG, "Synchronized time: %04d-%02d-%02d %02d:%02d:%02d", time.year, time.month, time.day_of_month, time.hour,
|
||||||
time.minute, time.second);
|
time.minute, time.second);
|
||||||
this->time_sync_callback_.call();
|
this->time_sync_callback_.call();
|
||||||
this->has_time_ = true;
|
this->has_time_ = true;
|
||||||
|
@ -35,7 +35,7 @@ void RealTimeClock::synchronize_epoch_(uint32_t epoch) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto time = this->now();
|
auto time = this->now();
|
||||||
ESP_LOGD(TAG, "Synchronized time: %d-%d-%d %d:%d:%d", time.year, time.month, time.day_of_month, time.hour,
|
ESP_LOGD(TAG, "Synchronized time: %04d-%02d-%02d %02d:%02d:%02d", time.year, time.month, time.day_of_month, time.hour,
|
||||||
time.minute, time.second);
|
time.minute, time.second);
|
||||||
|
|
||||||
this->time_sync_callback_.call();
|
this->time_sync_callback_.call();
|
||||||
|
Loading…
Reference in New Issue
Block a user