I am the happy owner of a brand new EdgeRouter 4. Put OpenWrt master on it, all fine, except Busybox date keeps showing UTC time instead of the CET time (all the other OpenWrt devices in the network happily print CET time with similar settings).
I don't think this device has a hardware clock, hwclock reports /dev/misc/rtc is missing e.g. Pointers are appreciated.
Syncing through LuCI's system tab doesn't make the time over SSH display as CET (LuCI itself seems to recalculate it correctly, showing CET).
Weird, something going wrong there then (on multiple devices). I already tried switching to another time zone and back, both in LuCI and over SSH, to no avail.
There's definitely some weirdness going on:
root@OpenWrt:~# echo 'CET-1CEST,M3.5.0,M10.5.0/3' > /tmp/TZ
root@OpenWrt:~# date
Thu Dec 10 21:07:57 UTC 2020
root@OpenWrt:~# service system reload
root@OpenWrt:~# date
Thu Dec 10 21:08:34 UTC 2020
root@OpenWrt:~# /etc/init.d/system reload
root@OpenWrt:~# date
Thu Dec 10 21:09:31 UTC 2020
root@OpenWrt:~# ls -l /tmp/TZ
ls: /tmp/TZ: No such file or directory
After removing /tmp/TZ myself and doing another full run of it:
root@OpenWrt:~# ls /tmp/TZ
ls: /tmp/TZ: No such file or directory
root@OpenWrt:~# echo 'CET-1CEST,M3.5.0,M10.5.0/3' > /tmp/TZ
root@OpenWrt:~# ls /tmp/TZ
/tmp/TZ
root@OpenWrt:~# /etc/init.d/system reload
root@OpenWrt:~# ls /tmp/TZ
ls: /tmp/TZ: No such file or directory
root@OpenWrt:~# date
Thu Dec 10 21:10:59 UTC 2020
For me it works ok, also on a device with master built today:
(and with the the default C lib, musl)
OpenWrt SNAPSHOT, r15182-8663072854
-----------------------------------------------------
root@router3:~# cat /tmp/TZ
EET-2EEST,M3.5.0/3,M10.5.0/4
root@router3:~# date -u
Thu Dec 10 21:14:32 UTC 2020
root@router3:~# date
Thu Dec 10 23:14:35 EET 2020
root@router3:~#
root@router3:~# rm /tmp/TZ
root@router3:~# date -u
Thu Dec 10 21:14:47 UTC 2020
root@router3:~# date
Thu Dec 10 21:14:48 UTC 2020
root@router3:~#
root@router3:~# /etc/init.d/system reload
root@router3:~#
root@router3:~# cat /tmp/TZ
EET-2EEST,M3.5.0/3,M10.5.0/4
root@router3:~# date -u
Thu Dec 10 21:15:06 UTC 2020
root@router3:~# date
Thu Dec 10 23:15:08 EET 2020
Have you installed the zoneinfo packages on the device that fails?
Do you have /tmp/localtime there?
(as that would lead to deleting /tmp/TZ. See /etc/init.d/system for reference, or the message that I referenced above)
Somehow misformatted /etc/config/system
(but that should not affect the situation when you manually change /tmp/TZ)
Musl & busybox have the capability to apply the POSIX string included in the config file. But some advanced apps (like php, real webservers, some python apps) might want the full zoneinfo, if they want direct access to all timezones.
zoneinfo is rarely installed.
Please read the explanation from the message that I linked above.
@hnyman Sorry for being a bit dense. At this point, all my builds have zoneinfo removed. There's no /tmp/localinfo either. Just /etc/TZ linking to a (now present) /tmp/TZ. But the time is still printed in UTC no matter what (timezone's set like before).
What I did notice, however, is that on my EdgeRouter Lite I set up today, the same thing is happening. Another octeon device showing UTC. My UCI defaults scripts set up a Europe/Brussels timezone at first installation, and on all my other devices that works like a charm. Looks like something else is at play here...