Часовой пояс arch linux

How can I easily change my time-zone in Arch/Xfce?

Since I move around, I need to be to change time-zones frequently. I’m on Arch/Xfce. How can I do that? I’ve tried right click on the watch on the top panel -> properties -> time settings -> time zone. It didn’t work. When I type a time-zone, it’s not auto-completing and not showing suggestions. When I enter it, nonetheless and press Ok, the time doesn’t change according to a new time-zone. What’s the proper way to do that?

3 Answers 3

It’s as simple as typing in just one command:

timedatectl set-timezone Zone/SubZone 

Where you replace Zone/SubZone with correct data. You can obtain list of all available timezones by typing:

timedatectl list-timezones 

If you want to have your RTC (hardware clock) using local time, run the following command:

timedatectl set-local-rtc 1 

If you prefer your RTC at UTC, use this one:

timedatectl set-local-rtc 0 

now my time is ahead of my previous time by the amount of hours my current time-zone has: so it’s +7 of the current time. why?

Do you have your RTC set to local or UTC? If it’s set to local, then use this command: timedatectl set-local-rtc 1 if otherwise: timedatectl set-local-rtc 0

what’s not the matter of what I want, the thing is «timedatectl set-timezone Zone/SubZone» didn’t set the time correctly. will timedatectl set-local-rtc help me and how?

You can check your real-time clock (RTC) with timedatectl status . I recommend setting it to universal time (UTC) since everything else (including your local time!) is defined as an offset of UTC. Also note that this works beyond just Arch Linux and beyond just XFCE.

Читайте также:  Linux get current runlevel

I was surprised how non-trivial this was, so I wrote a script:

Or, to pick a timezone from a list:

The following script also updates the timezone in:

#!/bin/bash set -euo pipefail program=$ # basename $0 usage () < >&2 printf 'Usage: %s [Region/City]\n' "$program" >&2 printf 'Set the system timezone\n' >&2 printf 'Will run tz-select to pick timezone if none given.\n' > # Process arguments if [[ $# -gt 1 ]]; then # 0 or 1 arguments only usage; exit 1 fi if [[ $# -eq 0 ]]; then # no timezone given - prompt timezone=$(tzselect) else timezone=$1 # in timedatactl verificaiton we trust fi sudo timedatectl set-timezone "$timezone" # `timedatectl set-timezone` doesn't update `/etc/timezone` # https://unix.stackexchange.com/q/451709/143394 /dev/null printf '\ntimedatectl says:\n' timedatectl # Update xfce4-panel clock # https://unix.stackexchange.com/a/227405/143394 if property=$(xfconf-query -c xfce4-panel --list | grep timezone); then if [[ $(wc -l <<<"$property") -eq 1 ]]; then # only one clock widget xfconf-query -c xfce4-panel -p "$property" -s "$timezone" printf '\nUpdated xfce4-panel clock timezone to: %s\n' "$timezone" else >&2 printf 'Not changing multiple xfce4-panel properties:\n%s\n' "$property" fi fi 

Источник

(Решено) Как сменить часовой пояс?

Вот именно +0300 меня и смущает. Кроме того время по ключу –localtime как раз то что мне надо, а вот в системе на час позже.

cucullus avatar

# With the default settings below, ntpd will only synchronize your clock. # # For details, see: # - the ntp.conf man page # - http://support.ntp.org/bin/view/Support/GettingStarted # - https://wiki.archlinux.org/index.php/Network_Time_Protocol_daemon # Select three geolocalized NTP public servers; see http://www.pool.ntp.org/ server 0.ua.pool.ntp.org iburst prefer server 1.ua.pool.ntp.org iburst server 2.ua.pool.ntp.org iburst # Only allow read-only access from localhost restrict default nomodify nopeer restrict 127.0.0.1 # Location of drift and log files driftfile /var/lib/ntp/ntp.drift logfile /var/log/ntp.log # NOTE: If you run dhcpcd and have lines like 'restrict' and 'fudge' appearing # here, be sure to add '-Y -N' to the dhcpcd_ethX variables in /etc/conf.d/net

mitch_t
Всем спасибо за помощь. Явного ответа не получил, но косвенно таки был дан ответ cucullus. Надо было просто обновить собственно пакет tzdata (и как я должен был догадаться об этом?).

© 2006-2023, Русскоязычное сообщество Arch Linux.
Название и логотип Arch Linux ™ являются признанными торговыми марками.
Linux ® — зарегистрированная торговая марка Linus Torvalds и LMI.

Источник

Оцените статью
Adblock
detector