Skip to content

Commit

Permalink
time fix
Browse files Browse the repository at this point in the history
  • Loading branch information
michelep committed Jun 3, 2020
1 parent ad38609 commit b9fd63f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion webserver.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ String templateProcessor(const String& var)
return String(millis()/1000);
}
if(var=="timedate") {
return String();
struct tm timeinfo;
if(!getLocalTime(&timeinfo)){
DEBUG_PRINTLN("Failed to obtain time");
return String("Error");
}
return String(String(timeinfo.tm_hour)+":"+String(timeinfo.tm_min)+":"+String(timeinfo.tm_sec));
}
if(var == "ota_enable") {
if(config.ota_enable) {
Expand Down

0 comments on commit b9fd63f

Please sign in to comment.