The translation is temporarily closed for contributions due to maintenance, please come back later.
Configuring the Date and Time
Modern operating systems distinguish between the following two types of clocks:
Using the timedatectl Command
For information on how to display the current date and time in a custom format, see also xref:Configuring_the_Date_and_Time.adoc#sect-Configuring_the_Date_and_Time-date[Using the date Command].
Displaying the Current Date and Time
Local time: Mon 2013-09-16 19:30:24 CEST
Universal time: Mon 2013-09-16 17:30:24 UTC
Timezone: Europe/Prague (CEST, +0200)
NTP enabled: no
NTP synchronized: no
RTC in local TZ: no
DST active: yes
Last DST change: DST began at
Sun 2013-03-31 01:59:59 CET
Sun 2013-03-31 03:00:00 CEST
Next DST change: DST ends (the clock jumps one hour backwards) at
Sun 2013-10-27 02:59:59 CEST
Sun 2013-10-27 02:00:00 CET
[command]#timedatectl# [option]`set-time` _HH:MM:SS_
~]#{nbsp}timedatectl set-time 23:26:00
[command]#timedatectl# [option]`set-time` _YYYY-MM-DD_
~]#{nbsp}timedatectl set-time "2013-06-02 23:26:00"
[command]#timedatectl# [option]`list-timezones`
[command]#timedatectl# [option]`set-ntp` _boolean_
~]#{nbsp}timedatectl set-ntp yes
Replace _format_ with one or more supported control sequences as illustrated in xref:Configuring_the_Date_and_Time.adoc#exam-Configuring_the_Date_and_Time-date-Display[Displaying the Current Date and Time]. See xref:Configuring_the_Date_and_Time.adoc#tabl-Configuring_the_Date_and_Time-date-Format[Commonly Used Control Sequences] for a list of the most frequently used formatting options, or the `date`(1) manual page for a complete list of these options.
|Control Sequence|Description
|[option]`%H`|The hour in the _HH_ format (for example, `17`).
|[option]`%M`|The minute in the _MM_ format (for example, `30`).
|[option]`%S`|The second in the _SS_ format (for example, `24`).
|[option]`%d`|The day of the month in the _DD_ format (for example, `16`).
|[option]`%m`|The month in the _MM_ format (for example, `09`).
|[option]`%Y`|The year in the _YYYY_ format (for example, `2013`).
|`%Z`|The time zone abbreviation (for example, `CEST`).
|[option]`%F`|The full date in the _YYYY-MM-DD_ format (for example, `2013-09-16`). This option is equal to [option]`%Y-%m-%d`.
|[option]`%T`|The full time in the _HH:MM:SS_ format (for example, 17:30:24). This option is equal to [option]`%H:%M:%S`
Mon Sep 16 17:30:24 CEST 2013
~]${nbsp}pass:attributes[{blank}][command]#date --utc#
Mon Sep 16 15:30:34 UTC 2013
~]${nbsp}date +"%Y-%m-%d %H:%M"
2013-09-16 17:30
By default, the [command]#date# command sets the system clock to the local time. To set the system clock in UTC, run the command with the [option]`--utc` or [option]`-u` command line option: