Skip to content

Commit

Permalink
Merge pull request #601 from DE-cr/include-current-datetime-in-config…
Browse files Browse the repository at this point in the history
…-page-for-all-systems

/C: include current date/time for all systems
  • Loading branch information
fredlcore authored Nov 16, 2023
2 parents 7c37e98 + ff17723 commit 7c2f3ba
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions BSB_LAN/BSB_LAN.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2159,12 +2159,9 @@ void generateConfigPage(void) {
unsigned long h = m / 60;
unsigned d = h / 24;
printFmtToWebClient(PSTR(MENU_TEXT_UPT ": %lu\r\nms = %ud+%02lu:%02lu:%02lu.%03lu<BR>\r\n"), ms, d, h%24, m%60, s%60, ms%1000);
#if defined(ESP32)
struct tm timeinfo;
if(getLocalTime(&timeinfo)){
printFmtToWebClient(PSTR(ENUM_CAT_00_TEXT ": %02d.%02d.%02d %02d:%02d:%02d<BR>\r\n"), timeinfo.tm_mday, timeinfo.tm_mon+1, timeinfo.tm_year-100, timeinfo.tm_hour, timeinfo.tm_min, timeinfo.tm_sec);
}
#endif
char *GetDateTime(char *date); // forward declaration, to avoid moving that function before this one here
char tmp_date[20];
printFmtToWebClient(PSTR(ENUM_CAT_00_TEXT ": %s<BR>\r\n"), GetDateTime(tmp_date));
#ifndef WEBCONFIG
printlnToWebClient(PSTR(MENU_TEXT_BUS ": "));
int bustype = bus->getBusType();
Expand Down

0 comments on commit 7c2f3ba

Please sign in to comment.