s00500 / ESPUI

A simple web user interface library for ESP32 and ESP8266
https://valencia.lbsfilm.at/midterm-presentation/
Other
896 stars 166 forks source link

TimeZone in ISO string {new Date().toISOString()} #296

Open woodix2023 opened 6 months ago

woodix2023 commented 6 months ago

How to display ISO date and time string taking into account TimeZone?

jberezin commented 1 month ago

I created option/select controls where the user could pick their timezone and pick their DST Type (USA,EU, or None).

I saved those options using arduinojson.

Then I add the timezone value to the iso time hours and add one more ( Hour++) if they are currently in Daylight savings time.

A simpler way may have been to use this branch: https://github.com/s00500/ESPUI/pull/278 but I am not sure because I didn't see that merge request until I had finished implementation.