mirror of https://github.com/tiyn/wiki
parent
fb8550be2e
commit
4b6e8d02b2
@ -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
|
||||||
|
```
|
@ -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
|
||||||
|
```
|
Loading…
Reference in new issue