date
SystemBeginner In simulator In real LinuxShow or set the date and time
Name: date
You can practise it right away in the simulator, and use it in real Linux mode too.
Description
date prints the current date and time, or in a +FORMAT you choose: +%F gives 2026-01-15, +%s a Unix timestamp. GNU date's -d parses and computes times, e.g. date -d "3 days ago".
Setting the clock needs root; timedatectl is preferred on modern systems.
Syntax
date [OPTION]... [+FORMAT]Common options
| +%F | Format: YYYY-MM-DD |
| +%T | Format: HH:MM:SS |
| +%Y%m%d-%H%M%S | Date and time run together, for file names: backup-$(date +%Y%m%d-%H%M%S).tar.gz |
| +%a %b %j %u | Weekday (Mon), month name (Jan), day of the year, weekday number (1–7) |
| +%s | Seconds since 1970 (Unix timestamp) |
| -d / --date STRING | Show a given time, e.g. -d tomorrow |
| -u / --utc | Use UTC |
| -I / --iso-8601 | ISO 8601 (-Iseconds adds the time) |
| -R / --rfc-email | The e-mail header format (Mon, 15 Jan 2026 09:30:00 +0000) |
| -r / --reference FILE | Show FILE’s modification time |
| -s / --set STRING | Set the system time (needs root) |