From 4b6e8d02b27b6d74baf43c63f6edd6e28fca90b5 Mon Sep 17 00:00:00 2001 From: TiynGER Date: Mon, 9 Aug 2021 19:00:07 +0200 Subject: [PATCH] linux: added date, time, timezone and hwclock guides --- wiki/linux/arch-linux/installation.md | 7 ++++- wiki/linux/date.md | 39 +++++++++++++++++++++++++++ wiki/linux/hwclock.md | 19 +++++++++++++ 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 wiki/linux/date.md create mode 100644 wiki/linux/hwclock.md diff --git a/wiki/linux/arch-linux/installation.md b/wiki/linux/arch-linux/installation.md index 9d367d5..5b06081 100644 --- a/wiki/linux/arch-linux/installation.md +++ b/wiki/linux/arch-linux/installation.md @@ -138,7 +138,12 @@ en_US.UTF-8 UTF-8 - `locale-gen` - Generate languages - `echo KEYMAP=de-latin1-nodeadkeys > /etc/vconsole.conf` - set the keymap -- `tzselect` - Set region +- `cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime` - set your timezone + (select the first file accordingly to your location) +- `date +%Y%m%d -s ""` - set the current date (change + values accordingly) +- `date +%T -s ""` - set the current time (change values accordingly) +- `hwclock -w` - sync the current date and time with the hardware clock ## 9. Configure and create kernel-image diff --git a/wiki/linux/date.md b/wiki/linux/date.md new file mode 100644 index 0000000..ac26360 --- /dev/null +++ b/wiki/linux/date.md @@ -0,0 +1,39 @@ +# Date + +`date` is a program to show and edit the date and time of a system. +To change the hardware clock look at the [according article](./hwclock.md) + +## Display time and date + +To change the time and date run the following command: + +```shell +date +``` + +## Change the date and time + +To change the date run the following command with an adjusted value for the +date: + +```shell +date +%Y%m%d -s "20210809" +``` + +To change the time run the following command with an adjusted value for the +date: + +```shell +date +%T -s "18:49:42" +``` + +After that you can check if the time is correct by displaying it. + +## Set timezone + +To set your timezone run the following command with the accordingly selected +file for your location: + +```shell +cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime +``` diff --git a/wiki/linux/hwclock.md b/wiki/linux/hwclock.md new file mode 100644 index 0000000..a561420 --- /dev/null +++ b/wiki/linux/hwclock.md @@ -0,0 +1,19 @@ +# HWClock + +`hwclock` is a program to set and display the hardware clock. + +## Display time and date + +To display the hardware clock run the following command: + +```shell +hwclock +``` + +## Sync the hardware clock to the system time + +To sync the hardware clock run the following command: + +```shell +hwclock -w +```