lk/basics/time.md
Malin Freeborn ba8026e0c3
change formatting
input examples are now given as

```bash
input $ARG1
```

While outputs use md's '> ' sign as a quote.
2023-06-17 21:28:20 +02:00

71 lines
1.1 KiB
Markdown

---
title: "time"
tags: [ "Documentation", "Basics" ]
---
# systemd
Set time to synchronize with an ntp server:
```bash
timedatectl set-ntp true
```
This info stays in `/usr/share/zoneinfo`.
# 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:
```bash
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:
```bash
locale
```
List available locales with:
```bash
locale -a
```
To see additional locales which are available (but not necessarily installed):
```bash
cat /usr/share/i18n/SUPPORTED
```
Set a supported locale with:
```bash
locale-gen pl_PL.UTF-8
```
Then set that language, with:
```bash
LANG=pl_PL.UTF-8
```
... then reboot.
# Network Time Protocol
Glimpse an overview with:
```bash
ntpq -p
```
Usually this is run as a service, so just start that service.