Skip to content
Justice Tech School

Formatting Dates

date +FORMAT prints parts of a date. -d parses a date.

Example
date -d "2026-03-15" +"%Y/%m/%d"
date -d "2026-03-15 +10 days" +%F
date -d "2026-03-15" +%A

Result

2026/03/15
2026-03-25
Sunday

Exercise

Year-month-day.

date +%

Quiz Test

What does %Y give?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.