lk/basics/time.md

55 lines
1.0 KiB
Markdown
Raw Normal View History

2022-01-16 18:20:39 +00:00
---
title: "time"
2022-01-26 21:29:48 +00:00
tags: [ "Documentation", "Basics" ]
2022-01-16 18:20:39 +00:00
---
2020-01-02 00:04:35 +00:00
# systemd
Set time to synchronize with an ntp server:
> timedatectl set-ntp true
2022-01-26 21:29:48 +00:00
This info stays in `/usr/share/zoneinfo`.
2020-01-02 00:04:35 +00:00
# Local Time
Local time is kept in /etc/localtime.
According to Dave's LPIC guide, you can set the local time by making asymboling link from your timezone to /etc/localtime, as so:
> sudo ln -sf /usr/share/zoneinfo/Europe/Belgrade /etc/localtime
...however this produced the wrong time for me. Further, /etc/localtime produces an output with cat, while the zoneinfo files do not.
# Locale
See local time, language and character settings with:
> locale
List available locales with:
> locale -a
To see additional locales which are available (but not necessarily installed):
> cat /usr/share/i18n/SUPPORTED
Set a supported locale with:
> locale-gen pl_PL.UTF-8
Then set that language, with:
> LANG=pl_PL.UTF-8
... then reboot.
# Network Time Protocol
2022-01-26 21:29:48 +00:00
Glimpse an overview with:
2020-01-02 00:04:35 +00:00
2022-01-26 21:29:48 +00:00
> ntpq -p
2020-01-02 00:04:35 +00:00
2022-01-26 21:29:48 +00:00
Usually this is run as a service, so just start that service.
2020-01-02 00:04:35 +00:00