Windows
Linux
System & Storage
System Info
Windows date /t & time /t equivalent in Linux
Shows the current date and time, or sets the system clock.
Windows
→
date /t & time /t
Linux equivalents
date
date
date
Overview
What this command does
Shows the current date and time, or sets the system clock.
Migration tip:
date supports powerful format strings. date +%Y-%m-%d prints the date in a format safe for filenames — no spaces or slashes.Practical tasks
Common use cases
Display or set date and time
Shows the current date and time, or sets the system clock.
date
Show current date and time
date +"%Y-%m-%d"
Date in YYYY-MM-DD format
date +"%H:%M:%S"
Time in HH:MM:SS format
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
date
date +"%Y-%m-%d"
date +"%Y%m%d_%H%M%S"
timedatectl
tar -czf backup_$(date +%Y%m%d).tar.gz ~/Documents
Walkthrough
Examples with explanations
# Windows: date /t and time /t
date # Sat Jan 15 14:32:00 EST 2025
date +"%Y-%m-%d" # 2025-01-15
date +"%Y%m%d_%H%M%S" # 20250115_143200 (for filenames!)
timedatectl # timezone, NTP sync status
# Use in filenames:
tar -czf backup_$(date +%Y%m%d).tar.gz ~/Documents
Reference
Common options and variations
| Command or option | Use |
|---|---|
date | Show current date and time |
date +"%Y-%m-%d" | Date in YYYY-MM-DD format |
date +"%H:%M:%S" | Time in HH:MM:SS format |
date -u | Show time in UTC |
timedatectl | Full time/timezone/NTP status |
Distro differences
Debian/Ubuntu vs Fedora vs Arch
This command is the same on Debian/Ubuntu, Fedora and Arch Linux when the relevant tool is installed.
| Distribution | Package manager / base | Equivalent command | Difference to notice |
|---|---|---|---|
| Debian/Ubuntu | same command | date |
Same command on this distribution. |
| Fedora | same command | date |
Same command on this distribution. |
| Arch | same command | date |
Same command on this distribution. |
Keep learning