How to change TimeZone?
Device Firmware Version: 0.2.0 b196
Web interface doesn't have 'Settings' page.
@Alexandr-Didenko Omega2(+) (ie OpenWrt) stores the time zone inside the '/etc/TZ' file and it operates in the UTC time zone by default.
So you should modify that file - more exactly the TZ variable - with ease on the Command Line. ;-)
The syntax of the TZ variable is documented here.
You can find the possible values of TZ in this
Time ZonesTime Zones table.
# Omega 2+ 0.2.0 b194 root@Omega-99A5:~# ls -l /etc/TZ lrwxrwxrwx 1 root root 7 Jul 31 16:32 /etc/TZ -> /tmp/TZ root@Omega-99A5:~# cat /etc/TZ GMT0 root@Omega-99A5:~# date Tue Sep 18 10:30:31 GMT 2018
To survive the power cycles and the
rebootcommands you should remove that symbolic link.
For example the correct contents of '/etc/TZ' when located in Budapest (Central Europe, Hungary) with Daylight Saving Time would be:
root@Omega-99A5:~# rm /etc/TZ root@Omega-99A5:~# echo "CET-1CEST,M3.5.0,M10.5.0/3" > /etc/TZ root@Omega-99A5:~# ls -l /etc/TZ -rw-r--r-- 1 root root 27 Sep 18 12:31 /etc/TZ root@Omega-99A5:~# cat /etc/TZ CET-1CEST,M3.5.0,M10.5.0/3 root@Omega-99A5:~# date Tue Sep 18 12:32:39 CEST 2018
Unfortunately you should repeat these steps after every FACTORY RESET,
firstbootand firmware up or downgrade.
Here you are another method.
This is maybe
simplerbetter because you don't have to remove that symbolic link and - with the above TZ example - the result is samea little bit better.
uci set system.@system.timezone='CET-1CEST,M3.5.0,M10.5.0/3'
uci commit system
You should repeat these steps after every FACTORY RESET or
@Alexandr-Didenko Since you're on the latest firmware, you also have the latest version of the
onioncommand line tool.
Connect to the command line and just run
onion, in the output there will be a section describing how to use this tool to list out the possible timezones and then how to set the timezone for your device:
Configure Device Time: onion [OPTIONS] time list List all available timezones and associated timezone string onion [OPTIONS] time set <TIMEZONE> <TIMEZONE STRING> Change the system timezone onion [OPTIONS] time sync Update system time from the internet
There's also a sync command you can use to force the Omega to update its system time from online NTP servers.
In my case; Istanbul is GMT+3 and I couldn't find the +3 for Istanbul and i create it myself. Details are here https://wiki.openwrt.org/doc/uci/system (Time Zones
uci set system.@system.timezone='EET-2EEST' uci set system.@system.zonename='Istanbul' uci commit echo "EET-2EEST" > /etc/TZ
this works without reboot.
@Lazar-Demin Great! :-)
Maybe some "announcement" in the Omega Firmware Changelog would be nice. For example:
@unique1984 You can find Istanbul in v0.2.0 192 and above:
onion time list | grep Istanbul Europe/Istanbul EET-2EEST,M3.5.0/3,M10.5.0/4
and really simple to set TZ for you with this command:
onion time set Europe/Istanbul EET-2EEST,M3.5.0/3,M10.5.0/4
@unique1984 OK! You are right :-)
I checked your TZ at Current Local Time in Istanbul, Turkey and Time Zone in Istanbul, Turkey.
It's UTC/GMT +3 and no Daylight Saving Time in 2017 — 2019.
(I didn't know this and misunderstood the TZ of Istanbul, Turkey vs. "+3 for Istanbul" ;-)
@György-Farkas This is a special case and I hope someone who suffering for this, can solve it in this way if those are having trouble in Turkey. Thank you.
root@Omega-6B4C:~# onion time list | grep Moscow
And this is error!
We have +3 zone
This command help me:
onion time set Europe/Moscow MSK-3
BTW There are "updated" OpenWrt TZ strings here and you can see the TZ string of Europe/Moscow has already corrected (but - for example - the TZ string of Europe/Istanbul has not).