8000 Wrong time displayed while correct timezone is set · Issue #195 · roleoroleo/sonoff-hack · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Wrong time displayed while correct timezone is set #195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
flreinhard opened this issue Mar 21, 2025 · 4 comments
Open

Wrong time displayed while correct timezone is set #195

flreinhard opened this issue Mar 21, 2025 · 4 comments

Comments

@flreinhard
Copy link
Contributor
flreinhard commented Mar 21, 2025

How can you see the error?

Time in snapshot, rtspstream and on commandline wrong.
In my case it's 15:00:00 in the stream/picture, but in real it's 16:00:00

requirements

  • ntp server is setup and sync is working
  • timezone configured (in my case Europe/Brussels)
  • Firmware V5520.2053.0505build20230320, fix won't work with V5520.2053.0412build20220905

what i think is wrong

if you call date it will rely on /etc/TZ which is a symlink to /tmp/TZ to make a localtime from UTC. Must be something custom in the glibc that got shipped with the camera.
Now in my case the content is EST+0:00:00 which is wrong in two different ways:

  1. it does not match my timezone
  2. the format is utterly wrong, gnu.org has the details

Since i live in CET Timezone which is UTC+1 the content should be CET-1
Works for me in theory and real life:
Broken:

root@TestCam]# cat /etc/TZ 
EST+0:00:00
[root@TestCam]# date
Fri Mar 21 21:32:12 EST 2025
[root@TestCam]# date -u
Fri Mar 21 21:32:14 UTC 2025

Now let's fix it:

[root@TestCam]# echo "CET-1" > /etc/TZ 
[root@TestCam]# date
Fri Mar 21 22:33:16 CET 2025
[root@TestCam]# date -u
Fri Mar 21 21:33:19 UTC 2025

Is it only me having that issue because i refused to configure the camera with ewelink?
What's your contents of /etc/TZ?

@roleoroleo
Copy link
Owner

This problem doesn't change if you configure the app with ewelink.
The file /etc/TZ is created by colink or devctrl (I don't remember exactly) reading the timezone table in the db.
And the db is set by the app and the web page (both).

Could you run these commands?

sqlite3 /mnt/mtd/db/ipcsys.db "select c_param_value from t_sys_param where c_param_name='ZoneTimeName';"
sqlite3 /mnt/mtd/db/ipcsys.db "select * from t_zonetime_info;"

I set Europe/Amsterdam and my time is ok.

@bob-cook
Copy link
bob-cook commented Apr 5, 2025

I haven't upgraded to 0.18 yet, so maybe my experience will be different than yours. I live in UTC-8 but found I had to set the timezone to UTC+8 (Asia/Hong_Kong) in order to get the correct local time. There is likely a backwards subtraction going on somewhere, but I've never spent any time trying to find it.

@roleoroleo
Copy link
Owner

Please, update to the last version and try again.

@bob-cook
Copy link
bob-cook commented Apr 5, 2025

NEW INFO: Updated to 0.18 this morning, timezone issue appears to be resolved, at least for my issue of UTC-8 vs. UTC+8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0