Miscellaneous

date

Display or set the system date and time with customizable formatting.

Synopsis

syntax
date [OPTION]... [+FORMAT]

Examples

Show current date and time
date
Print date in YYYY-MM-DD format
date +%Y-%m-%d
Show current UTC time
date -u
Show date one week from now
date -d '+1 week'
Print Unix epoch timestamp
date +%s

Common options

FlagDescription
-uDisplay or set UTC time
-dDisplay time described by string
-sSet time
-IISO 8601 format
-RRFC 2822 format

About date

The `date` command display or set the system date and time with customizable formatting. Utility commands cover a broad range of everyday tasks from date manipulation and arithmetic to terminal control and system documentation.

These tools fill in the gaps between major categories and are frequently used in shell scripts, cron jobs, and interactive sessions. The command accepts 5 commonly used flags shown above, though the full set of options is available in the man page (`man date`).

The 5 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.

Related commands

More Miscellaneous Commands

Other commands in the Miscellaneous category

Related tools