Timezone - LuCI does not reflect timezone set in /etc/config/system

Oh never mind please. I got LuCI's System and /etc/config/system timezones to coordinate by editing LuCi and seeing what it does to config, instead of the other way around. Editing LuCI also answers question 4.

--

My router is a TP-link C7 v5 running on a OpenWrt release 19.07.8 custom image.

In /etc/config/system, I changed the timezone from UTC to local. The relevant portion (before editing) looks like:

config system
        option hostname 'OpenWrt'
        option timezone 'UTC'

The result is that I get local time in logs and LuCI displays, or at least these two (so far confirmed):

  • /var/log/auth.log [Never mind this. I got confused.]
  • LuCI > Services > Dynamic DNS > the "Last Update, Next Update" column

However, timezone is still UTC in

  • LuCI > System > General Settings (tab) > Timezone

Question

  1. Is Timezone in LuCI-System-General Settings supposed to coordinate with /etc/config/system?

  2. If yes to 1, what could have gone wrong? How can I get them to coordinate? (I rebooted the router.)

  3. If no to 2, what is Timezone LuCI-System-General Settings supposed to control, indicate, etc.?

  4. For Los Angeles, what is the value to put in /etc/config/system. The following page gives this complex string, { 'America/Los Angeles', 'PST8PDT,M3.2.0,M11.1.0' }. Am I supposed to enter PST8PDT,M3.2.0,M11.1.0 or just one of the three?

https://github.com/openwrt/luci/blob/master/modules/luci-base/luasrc/sys/zoneinfo/tzdata.lua

This sounds a lot like the known bug with Octegon devices (Edgerouter4) that timezone settings aren’t working no matter what TZ settings you choose?

Maybe it is a more general bug and not isolated to Octegon?

https://forum.openwrt.org/t/21-02-etc-tz-not-read/101768/17?u=flygarn12

Yes, there are no special "LuCI settings". LuCI just reads and manipulates the global config files like /etc/config/system.

You are expected to has two values there:

  • zonename = textual name of the zone, shown in LuCI and used if you have installed full zoneinfo packages.
  • timezone, the simple POSIX string like 'PST8PDT,M3.2.0,M11.1.0' that tells the basic timezone plus DST start and end dates. That string is normally used as the main info (if the optional zoneinfo packages are not installed)

So, make sure that you have the "timezone" string there.
Example:

 option timezone 'EET-2EEST,M3.5.0/3,M10.5.0/4'
 option zonename 'Europe/Helsinki'
2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.