Closed mcspr closed 3 years ago
Gist of the issue:
UI receives raw seconds unix timestamp and we use (new Date(timestamp * 1000)).toISOString()
to print it (Stripping T and Z symbols, as it is ISO string output). This is done because NTPCLientLib used to output unix timestamp in local timezone.
Current NTP library uses UTC, but string still shows the same data :)
now
variable and ticks it +1 every second locally
https://github.com/xoseperez/espurna/blob/2dcf1b2bd80ea2474275254bec722aa8905bf6c5/code/html/custom.js#L2187
Purpose of that is to show sort-of current device time, see span[name="now"], input[name="now"]. span[name="ago"] is a separate entity that only tracks seconds since the latest "uptime" received.toLocaleString()
can render timestamp in browser timezone, but it is kind of pointless.so, basically setting the correct time zone only matters when scheduler is used ?
Right now, yes, this is only a display issue. See ntp
terminal output for example.
hi. i'm kind of having the same issue .. but weird .. when i set UTC+2 .. in debug shows wrong by cutting 2h instead of adding them .. if i put -2 it will do the correct thing while in status page nothing seems to change.
Probably unrelated !! using pzem 004t with voltage level shifter : observing that values (power, voltage, etc) aren't changing instantly .. compared to another pzem016 i have. is this normal ??
having sensors set to read and report every 1sec - reading seems to still be done every 6sec ! , reporting looks fine at least on debugging.
ESPURNA 1.14.2-dev PZEM004T-12F
THX.
Quoting the doc from the gnu.org:
The offset specifies the time value you must add to the local time to get a Coordinated Universal Time value. It has syntax like [+|-]hh[:mm[:ss]]. This is positive if the local time zone is west of the Prime Meridian and negative if it is east. The hour must be between 0 and 24, and the minute and seconds between 0 and 59.
UTC+2
means -2h per the specification, you need to use UTC-2
. Or, like it happens to work with -2
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
Closing via aec13cef63d12ccf1f03a72f55079c6bdb1c120b
I noticed a problem with the time display. I have defined server and time zone in custom.h
the time refresh process is running correctly, timezone is also correctly decoded because I see in webinterface:
but on webinterface I still see time as UTC (18h instead 20h)
Originally posted by @reaper7 in https://github.com/xoseperez/espurna/issues/2219#issuecomment-612157081