๐ŸŽ New User? Get 20% off your first purchase with code NEWUSER20 ยท โšก Instant download ยท ๐Ÿ”’ Secure checkout Register Now โ†’
Menu

Categories

๐Ÿ–ฅ๏ธ System Information August 8, 2026 2

Linux Command: date

Display or set the system date and time

Terminal โ€” System Information
Command
$ date
Output
Mon Jan 15 14:30:00 UTC 2024

date displays or sets the system date and time. It supports extensive formatting options for creating timestamps, date calculations, and converting between date formats. date is essential for log timestamps, backup naming, cron job reporting, and any script that needs to work with dates. It supports format strings with + prefix for custom output. date can perform date arithmetic with the -d flag, allowing you to calculate relative dates like "yesterday", "next friday", "2 hours ago", and more.

Syntax

date [OPTION]... [+FORMAT]

Key Options

  • +FORMAT โ€” Custom output format
  • -d โ€” Display specified date (not current)
  • -u โ€” Display UTC time
  • -s โ€” Set the system date/time
  • -R โ€” RFC 2822 format (for email)
  • -I โ€” ISO 8601 format

Examples

Current date and time

date

Output: Mon Jan 15 14:30:00 UTC 2024

Custom format

date "+%Y-%m-%d %H:%M:%S"

Output: 2024-01-15 14:30:00

Unix timestamp

date +%s

Output: 1705327800

Pro Tips

  • %Y=year, %m=month, %d=day, %H=hour, %M=minute, %S=second, %s=epoch, %A=weekday name, %B=month name.
  • date -d supports: yesterday, tomorrow, last friday, 2 weeks ago, +3 months, next year, etc.
  • On systemd systems, use timedatectl set-time instead of date -s. Ensure NTP is disabled first.

Learn more: Full date reference โ†’

Share this tip