Skip to content
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

Problems with setting timezone #17

Open
KitBishop opened this issue Apr 13, 2016 · 9 comments
Open

Problems with setting timezone #17

KitBishop opened this issue Apr 13, 2016 · 9 comments

Comments

@KitBishop
Copy link

This is by way of re-opening issue: #14
Further testing shows that the issue is browser dependent:
Firefox - setting time zone does NOT work
Microsoft Edge - setting time zone does NOT work
Chrome - setting time zone DOES work

@greenbreakfast
Copy link
Contributor

Hmm ok, this gives us a clue to work with! We'll take a look and let you know!

@asez73
Copy link

asez73 commented Apr 14, 2016

Hi again @greenbreakfast , this time is about timezone with Firefox/Ubuntu 14.04:

a- it is always shown as unset, including after a reboot of the omega:
capture du 2016-04-14 09 53 41

b- I can select and validate my timezone:
capture du 2016-04-14 09 54 07

c- after this and a refresh of the web page, it still shows as unset: identical screenshot as in (a).

d- when I connect to the Terminal application, I can see that time and date are wrong as well as the timezone is still utc:
capture du 2016-04-14 10 00 02

@asez73
Copy link

asez73 commented Apr 14, 2016

So I did found a bit more about time and time zone. Actually, time and date are setup as seen below.
But the timezone is not set as the current time should be +2 hours daylight savings included...
Referring to this page, I could enforce the timezone.
Notes:

  • the sign of your timezone is reversed with what is displayed on the Console settings, which is NORMAL(??).
  • the dalylight savings (summer time) are apparently not accounted correctly, I had to use -2 instead of -1 in my manual setup

root@Omega-17E8:# date
Thu Apr 14 08:27:54 GMT 2016
root@Omega-17E8:
# uptime
08:32:10 up 1:21, load average: 0.00, 0.02, 0.04
root@Omega-17E8:# cat /etc/TZ
GMT0
root@Omega-17E8:
# echo GMT-2:00 > /etc/TZ
root@Omega-17E8:# date
Thu Apr 14 10:43:03 GMT 2016
root@Omega-17E8:
# uname -a
Linux Omega-17E8 3.18.29 #2 Tue Apr 5 00:55:19 UTC 2016 mips GNU/Linux
root@Omega-17E8:~#

@KitBishop
Copy link
Author

@asez73 In relation to your posts above:
First, as per my earlier comments, setting the timezone in the console doesn't work from Firefox. It does work from Chrome. This is not the first time there have been issues with Firefox.

Secondly, attempting to set the time zone by changing /etc/TZ doesn't always work as expected. To set the timezone manually, you need to change /etc/config/system
There are two ways to go about this:

a. Hand edit the file /etc/config/system to set the entries option timezone and option zonename in the config system section to appropriate values (see later).
Then reboot your Omega

b. Use uci set and uci commit commands as follows(see later for actual values for and ):
uci set system.@System[0].timezone=''
uci set system.@System[0].zonename=''
uci commit system

The timezone and zonename values that should be used can be discovered from the file /www/apps/onion-settings/onion-settings-general.html in the definition of timezones from line 93 onwards.
For each entry, the timezone is given by the tz value and the zonename is given by the name value.
Note in particular that the tz values include information pertaining to the zone code, it's offset from UTC and information concerning the dates at which daylight savings changes.

I deduce from the screen shots you show above that you need:
zonename='Brussels, Copenhagen, Madrid, Paris'
timezone='CET-1CEST,M3.5.0,M10.5.0/3'

Hope this all helps.

@greenbreakfast
Copy link
Contributor

Yep, everything @KitBishop said is correct.

We will be fixing the browser issues within the next two or three weeks. I'll make sure to ping you guys to confirm it works on your end then.

For now, please use Chrome for the best Omega Console experience

@asez73
Copy link

asez73 commented Apr 14, 2016

@KitBishop , thank's for your help, it worked correctly (editor method and cut/paste in /etc/config/system) with a slight detail: The console settings displays Berlin, while /etc/config/system says Brussels... That the first zonename for the timezone: it's not really important anyway as far as time and daylight savings are correct.
capture du 2016-04-14 18 15 15

capture du 2016-04-14 18 18 53

So thank's again.

@asez73
Copy link

asez73 commented Apr 14, 2016

@greenbreakfast , yes I think this would make life simpler. However, life without Google is not uninteresting also 😈

@KitBishop
Copy link
Author

@asez73 Glad it worked for you :-)
Regarding what the console is saying for the zone after you make the changes:
The code used is effectively keyed off the timezone value. In your case the timezone is:
CET-1CEST,M3.5.0,M10.5.0/3
In the timezones table in onion-settings-general.html there are 4 entries with this timezone, they have zonenames of:

  1. Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
  2. Belgrade, Bratislava, Budapest, Ljubljana, Prague
  3. Brussels, Copenhagen, Madrid, Paris
  4. Sarajevo, Skopje, Warsaw, Zagreb
    In that order, so the one with Amsterdam, Berlin.... gets selected.
    While probably not a big issue since the time will still be set correctly, perhaps (as a low priority) the Omega guys should consider a different method of handling timezones such that each entry is uniquely identified.

@Photonicsguy
Copy link

If you don't have console installed, you can access the file from here:
https://github.com/OnionIoT/Onion-Console/blob/master/www/apps/onion-settings/onion-settings-general.html

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

4 participants