xoseperez / espurna

Home automation firmware for ESP8266-based devices
http://tinkerman.cat
GNU General Public License v3.0
2.97k stars 635 forks source link

UI - Status page - Current time should be local time, not UTC time #2608

Open brunetton opened 1 week ago

brunetton commented 1 week ago

Device

itead-sonoff-dual-r2

Version

1.16.0-dev.git7536a6ed+github240615

Bug description

Time displayed in UI is UTC time, not local time

Steps to reproduce

Context

Steps

That is not correct, it should be either:

Note

I'm not asking for summer time support in Espurna, I can manually manage this in my schedules

get ntpTZ
> ntpTZ => "CET"
+OK

Build tools used

No response

Any relevant log output (when available)

No response

Decoded stack trace (when available)

No response

mcspr commented 4 days ago

2024-06-19 22:04:32 UTC or better: 2024-06-19 23:04:32 CET

What about explicit offset then? Currently, there is none

2024-06-19 22:04:32

Commit above adds +HH:MM offset at the end for the status page

2024-06-19 22:04:32 +01:00

Internally, this looks slightly different though

2024-06-19T22:04:32+01:00

In case of UTC

2024-06-19T21:04:32Z

fwiw ntpTZ is not really a TZ name, but a specification string for either plain offset or DST settings. In case of CET / CEST - CET-1CEST,M3.5.0,M10.5.0/3 - outputting that near the timestamp would be pretty verbose. Although, while it seems it would be possible to extract text strings for DST and non-DST, libc routines that are used for timezones are not actually returning the numerical offset for DST and non-DST :/