mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
shower time with timezone
This commit is contained in:
@@ -107,8 +107,8 @@ void Shower::loop() {
|
||||
time_t now = time(nullptr);
|
||||
if (now > 1576800000) { // year 2020
|
||||
tm * tm_ = localtime(&now);
|
||||
char dt[20];
|
||||
strftime(dt, sizeof(dt), "%T", tm_);
|
||||
char dt[25];
|
||||
strftime(dt, sizeof(dt), "%FT%T%z", tm_);
|
||||
doc["time"] = dt;
|
||||
}
|
||||
Mqtt::queue_publish("shower_data", doc.as<JsonObject>());
|
||||
|
||||
Reference in New Issue
Block a user