date

Linux · System · available in the simulator

What it does

Display or set the system date and time.

Syntax

date [opciones] [+formato]

Options and parameters

  • -s

    Set time described by STRING; requires privileges.

  • -u

    Print or set Coordinated Universal Time (UTC).

  • +FORMATO

    Output date formatted according to FORMAT.

    date +%Y-%m-%d
  • -d

    Display time described by STRING, not 'now'.

    date -d "tomorrow"
  • -R

    Output date and time in RFC 5322 format.

Usage examples

  • date
  • date +%Y-%m-%d
  • sudo date -s '2026-06-01 10:00'
  • date '+%Y-%m-%d %H:%M:%S'
  • date -d "tomorrow"
Practise date

Related commands