mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 08:49: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"];
|
String timeUtc = json["time_utc"];
|
||||||
struct tm tm = {0};
|
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 = strptime(timeUtc.c_str(), "%Y-%m-%dT%H:%M:%SZ", &tm);
|
|
||||||
|
|
||||||
char * s = nullptr;
|
|
||||||
if (s != nullptr) {
|
if (s != nullptr) {
|
||||||
time_t time = mktime(&tm);
|
time_t time = mktime(&tm);
|
||||||
struct timeval now = {.tv_sec = time};
|
struct timeval now = {.tv_sec = time};
|
||||||
|
|||||||
Reference in New Issue
Block a user