mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
strftime is back
This commit is contained in:
@@ -71,10 +71,7 @@ void NTPSettingsService::configureTime(AsyncWebServerRequest * request, JsonVari
|
||||
String timeUtc = json["time_utc"];
|
||||
struct tm tm = {0};
|
||||
|
||||
// TODO fix strptime, which is not included in xtensa
|
||||
// char * s = strptime(timeUtc.c_str(), "%Y-%m-%dT%H:%M:%SZ", &tm);
|
||||
|
||||
char * s = nullptr;
|
||||
char * s = strptime(timeUtc.c_str(), "%Y-%m-%dT%H:%M:%SZ", &tm);
|
||||
if (s != nullptr) {
|
||||
time_t time = mktime(&tm);
|
||||
struct timeval now = {.tv_sec = time};
|
||||
|
||||
Reference in New Issue
Block a user