Skip to content

Commit

Permalink
use timezone directly from /usr/share/zoneinfo rather than /usr/shar/…
Browse files Browse the repository at this point in the history
…zoneinfo/posix

Firefox was not picking up correct timezone and Chromium gave error about incorrect timezone.
Looks like the browsers read timezone by looking at the symlink from /etc/localtime to
/usr/share/zoneinfo/CONTINENT/REGION.

Linking to /usr/share/zoneinfo/posix/CONTINENT/REGION seems to be messing this logic up,
so link to the direct location.

Helpful links:
https://bugs.chromium.org/p/chromium/issues/detail?id=811403
https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  • Loading branch information
abchk1234 committed Oct 2, 2018
1 parent 320706c commit 90ce272
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/timeset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ else
echo -e "$(date) ($(date +%z))" "$BOLD" "<-Local time" "$CLR" "\n$(date -u) (UTC)" "$BOLD" " <-UTC" "$CLR"
}
list_timezones() {
find -L /usr/share/zoneinfo/posix -mindepth 2 -type f -printf "%P\n" | sort | less
find -L /usr/share/zoneinfo -mindepth 2 ! -path '*/posix/*' ! -path '*/right/*' -type f -printf "%P\n" | sort | less
}
set_timezone() {
if [ -f "/usr/share/zoneinfo/posix/$1" ]; then
ln -sf "/usr/share/zoneinfo/posix/$1" /etc/localtime && echo "$(gettext 'Timezone set to') $1"
if [ -f "/usr/share/zoneinfo/$1" ]; then
ln -sf "/usr/share/zoneinfo/$1" /etc/localtime && echo "$(gettext 'Timezone set to') $1"
else
msg 'Wrong timezone entered.'
fi
Expand Down

0 comments on commit 90ce272

Please sign in to comment.