1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-29 05:21:37 +03:00

import getLocalTime() from esp32/Arduino (#8413)

* import getLocalTime() from esp32/Arduino
follows #8407
This commit is contained in:
david gauchard
2022-01-04 22:20:20 +01:00
committed by GitHub
parent f26201e6a9
commit a05a71fa9d
4 changed files with 28 additions and 25 deletions

View File

@ -19,29 +19,6 @@ long timezone = 2;
byte daysavetime = 1;
bool getLocalTime(struct tm * info, uint32_t ms) {
uint32_t count = ms / 10;
time_t now;
time(&now);
localtime_r(&now, info);
if (info->tm_year > (2016 - 1900)) {
return true;
}
while (count--) {
delay(10);
time(&now);
localtime_r(&now, info);
if (info->tm_year > (2016 - 1900)) {
return true;
}
}
return false;
}
void listDir(const char * dirname) {
Serial.printf("Listing directory: %s\n", dirname);