We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5bd2a6f commit b08986bCopy full SHA for b08986b
lib/App/App.cpp
@@ -27,9 +27,9 @@ const char *appDateTime()
27
{
28
time_t now = time(nullptr);
29
localtime_r( &now, &appTimeinfo );
30
- sprintf( appDateTimeBuffer, "%4d-%02d-%02d %02d:%02d:%02d",
+ sprintf( appDateTimeBuffer, "%4d-%02hd-%02hd %02hd:%02hd:%02hd",
31
appTimeinfo.tm_year+1900, appTimeinfo.tm_mon+1, appTimeinfo.tm_mday,
32
- appTimeinfo.tm_hour, appTimeinfo.tm_min, appTimeinfo.tm_sec );
+ appTimeinfo.tm_hour, appTimeinfo.tm_min, appTimeinfo.tm_sec);
33
return appDateTimeBuffer;
34
}
35
@@ -40,9 +40,11 @@ const char *appUptime()
40
int uptimeMinutes = (uptime / 60) % 60;
41
int uptimeHours = (uptime / 3600) % 24;
42
time_t uptimeDays = (uptime / 86400);
43
+
44
sprintf( appUptimeBuffer,
- "%ld days, %d hours, %d minutes, %d seconds",
45
+ "%llu days, %d hours, %d minutes, %d seconds",
46
uptimeDays, uptimeHours, uptimeMinutes, uptimeSeconds );
47
48
return appUptimeBuffer;
49
50
lib/WebHandler/WebHandler.cpp
@@ -46,6 +46,7 @@ const char *getJsonStatus(WiFiClient *client)
"\"ctime\":\"%s\","
"\"timezone\":\"%s\","
"\"uptime\":\"%s\","
+ "\"dateTime\":\"%s\","
"\"host_name\":\"%s.local\","
51
"\"esp_full_version\":\"%s\","
52
"\"esp_core_version\":\"%s\","
@@ -86,6 +87,7 @@ const char *getJsonStatus(WiFiClient *client)
86
87
strtok( ctime(&now), "\n" ),
88
TIMEZONE,
89
appUptime(),
90
+ appDateTime(),
91
wifiHandler.getHostname(),
92
ESP.getFullVersion().c_str(),
93
ESP.getCoreVersion().c_str(),
0 commit comments