OpenWrt Forum Archive

Topic: Timezone settings in openwrt

The content of this topic has been archived on 5 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi
This is the configuration of timezone on my OpenWRT:

config 'system'
        option 'hostname' 'OpenWrt'
        option 'timezone' 'CET-1CEST,M3.5.0,M10.5.0/3'

The problem is that every time 'date' command give me the time in UTC notation.

root@OpenWrt:/etc/config# date
Tue Oct 18 06:38:54 UTC 2011

How to force date to show local time? Moreover I have problem with my own software, where local time is the same as UTC.

Thanks for any advice.

Make sure the timezone did end up in /etc/TZ.

@jow:
while there is now a discussion regarding timezones, I hijack the thread:

What is the relation between "zoneinfo" packages Openwrt base system and LuCI?
Are the zoneinfo packages needed at all in the firmware builds? I have been including the zoneinfo/core, europe and northamerica packages in my builds, but I wonder if there is a need to do that? Is the embedded data in LuCI enough?

It seems to me that LuCI has an embedded version of them, which it uses (and which embedded data is a bit outdated 2010i version).

Btw, the zoneinfo packages are 2011i versions, and also that is outdated, as the current version is already 2011l (Released 10 October 2011).

http://luci.subsignal.org/trac/browser/ … offset.lua
http://luci.subsignal.org/trac/browser/ … tzdata.lua
https://dev.openwrt.org/browser/package … o/Makefile

----

Additionally, ICANN / IANA is taking over the maintenance of the timezone info to some extent (due to the lawsuits against the original maintainers), so it might be worthwhile to change the download link to them.

More info at http://www.iana.org/time-zones , downloads from: ftp://ftp.iana.org/tz/releases/  and http://www.iana.org/time-zones/repository/releases/

Completely unrelated. No. No. Yes.

Backfire (10.03.1, r29592)

Even with /etc/TZ containing

CET-1CEST,M3.5.0,M10.5.0/3

and with /etc/config/system containing

option 'zonename' 'Europe/Berlin'
option 'timezone' 'CET-1CEST,M3.5.0,M10.5.0/3'

the daylight saving time was not set this night,

# date
Sun Mar 25 18:20:55 CET 2012

It should be 19:20:55, CEST. (central european summer time)

The installed packages are: 6in4 6to4 base-files block-hotplug block-mount busybox crda dnsmasq dropbear e2fsprogs firewall hotplug2 ip ip6tables iptables iptables-mod-conntrack iptables-mod-ipopt iptables-mod-nat iw kernel kmod-ath kmod-ath9k kmod-ath9k-common kmod-button-hotplug kmod-cfg80211 kmod-crc-ccitt kmod-crypto-aes kmod-crypto-arc4 kmod-crypto-core kmod-fs-ext3 kmod-fs-mbcache kmod-input-core kmod-input-gpio-buttons kmod-input-polldev kmod-ip6tables kmod-ipt-conntrack kmod-ipt-core kmod-ipt-ipopt kmod-ipt-nat kmod-ipt-nathelper kmod-iptunnel4 kmod-ipv6 kmod-leds-gpio kmod-mac80211 kmod-nls-base kmod-ppp kmod-pppoe kmod-scsi-core kmod-sit kmod-usb-core kmod-usb-ohci kmod-usb-printer kmod-usb-serial kmod-usb-serial-ftdi kmod-usb-storage kmod-usb2 libblkid libc libext2fs libgcc libip4tc libip6tc libiwinfo libiwinfo-lua liblua libncurses libnl-tiny libpthread librt libuci libuci-lua libuuid libxtables lua luci luci-app-firewall luci-app-p910nd luci-app-radvd luci-i18n-english luci-lib-core luci-lib-ipkg luci-lib-lmo luci-lib-nixio luci-lib-sys luci-lib-web luci-mod-admin-core luci-mod-admin-full luci-proto-6x4 luci-proto-core luci-proto-ppp luci-sgi-cgi luci-theme-base luci-theme-openwrt minicom mtd opkg p910nd ppp ppp-mod-pppoe radvd swconfig uci udevtrigger uhttpd wireless-tools wpad-mini

What could cause this?
Could something be missing?

Hi, have same problem. Time not changed today to summer +1h.

I Also have/had this problem ...

when i changed the "zone" from Europe/Berlin to Europe/Istanbul
it shows the correct (summer-)time

so i changed the TZ ( /etc/TZ) :

'CET-1CEST,M3.5.0,M10.5.0/3'

into -

'CET-2CEST,M3.5.0,M10.5.0/3'

hmm seems to be a dirty hack but THAT helped me - that my cron-jobs now fit again in time ...
that is a temp-solution - but does not fix the reason (which i don't know)

i don't know if that is boot-stable ... (reboot everday @ 5 a.m.)
smile will see tomorrow ...

regards

(Last edited by polarie on 26 Mar 2012, 14:01)

The reason for the error is that the last day of March is this time a Saturday...
The actual bug is in uClibc code and has been patched there in late 2011. Backfire uses an ancient uClibc version, so the patch is not yet there. (Trunk uses more recent uClibc, so it works ok.)

A patch has been introduced to Backfire code today and Backfire builds after r31074 should work ok. More discussion here:
https://dev.openwrt.org/ticket/11181#comment:2


Temporary fix for older builds is to change the timezone rule to act on 4th Sunday in March:

/etc/config/system

 config 'system'
     option 'hostname' 'bob'
     option 'zonename' 'Europe/Copenhagen'
-    option 'timezone' 'CET-1CEST,M3.5.0,M10.5.0/3'
+    option 'timezone' 'CET-1CEST,M3.4.0,M10.5.0/3'

(Last edited by hnyman on 26 Mar 2012, 14:12)

ah thx hnyman

so changing the TZ line
(for noob-user like i am)
also brigns the result ...
'CET-1CEST,M3.4.0,M10.5.0/3'
set to 4 (and not to 5)
couse this year the March only has 4 sundays

polarie wrote:

'CET-1CEST,M3.4.0,M10.5.0/3'
set to 4 (and not to 5)
couse this year the March only has 4 sundays

Yep.
The reason was actually more complicated: a wrong leap year correction algorithm.  It erroneously added one extra day to the month, and got into the decision that the DST will change on Sunday March 32nd ;-) ;-)

So, the error required the combination of
- usage of Mx.5.0 (last Sunday) as algorithm,
- a leap year
- Saturday (Sunday-1) as the last day of the month.

hmm so when i look @ my calendar 
same should be done for october - couse ther wil be also a "missing" 5th sunday ...

'CET-1CEST,M3.4.0,M10.4.0/3'

correct - or unneccesary?

EDIT:

hmm october has not the sunday as last day of the month

so it will be un-important ...
thx for explanaition

(Last edited by polarie on 26 Mar 2012, 14:45)

Greetings,

I hope you can help me because I have the same problem.
I tried but it didn't work. So right now I don't know what to change to have the correct time and date.

The konfigurations in: /etc/TZ

UTC

The konfigurations in: /etc/config/system 
config system

         option hostname OpenWrt
         option timezone UTC

config timeserver ntp

        list server     0.openwrt.pool.ntp.org
        list server     1.openwrt.pool.ntp.org
        list server     2.openwrt.pool.ntp.org
        list server     3.openwrt.pool.ntp.org

I come from Ljubljana  (Slovenia - EU)

And some informations. On this LINK i found Europe/Ljubljana    CET-1CEST,M3.5.0,M10.5.0/3

And when I write 

TZ=c date

in terminal is 1 hour time differenc

So pleas hellp me to have the correct time!


Thank You!

Well i found the solution inside the LUCI

Go to from the tab "Status" to tab "System" and udnher tab "System"!

If your Tab "System" dosen't work than change back the configurations in /etc/TZ and /etc/config/system  to the defaulst!

And then you can magane the time and locastion...

The discussion might have continued from here.