add logging date support

This commit is contained in:
Dmitry Borisenko
2020-03-24 19:01:11 +01:00
parent a038960a4c
commit 0cf60ab214
27 changed files with 232 additions and 207 deletions

View File

@@ -28,11 +28,11 @@ void reconfigTime() {
#endif
#ifdef ESP8266
// while (!time(nullptr) && i < 4) {
// Serial.print(".");
// i++;
delay(2000);
// }
// while (!time(nullptr) && i < 4) {
// Serial.print(".");
// i++;
delay(2000);
// }
#endif
Serial.print("[i] Time = ");
@@ -40,14 +40,17 @@ void reconfigTime() {
Serial.print(" ");
Serial.println(GetTime());
time_t now = time(nullptr);
Serial.println(now);
} else {
Serial.println("[E] Get time impossible, no wifi connection");
}
}
//Получаем время в формате linux
int GetTimeUnix() {
time_t now = time(nullptr);
return (now);
}
// Получение текущего времени
String GetTime() {
time_t now = time(nullptr); // получаем время с помощью библиотеки time.h