# Dates and Times

date followed by + and a pattern prints a date in the shape you need, such as date +%F for 2026-11-09; date -d works out other days, such as 7 days ago; date +%s counts seconds, for timing a job; and a Mac's date uses -v instead of -d.

![Cheat sheet for the lesson Dates and Times: date followed by + and a pattern prints a date in the shape you need, such as date +%F for 2026-11-09; date -d works out other days, such as 7 days ago; date +%s counts seconds, for timing a job; and a Mac's date uses -v instead of -d.](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/ea6e023005214688a21c623893eedfb3.webp)

- Category: Bash
- Level: Journeyman
- Tags: command-substitution, date, linux, unix, unix-time
- Updated: November 10, 2026

Source: https://www.ask-codey.com/cheat-sheets/bash-dates-cheat-sheet
