Date & Time Format Directives
These directives are commonly used in tools likedate, logging systems, and programming languages to format timestamps.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
date, logging systems, and programming languages to format timestamps.
| Directive | Represents | Example |
|---|---|---|
%Y | 4-digit year | 2026 |
%m | Month | 01-12 |
%d | Day of month | 01-31 |
%H | Hour (24-hour format) | 00-23 |
%M | Minute | 00-59 |
%S | Second | 00-59 |
%Y-%m-%d %H:%M:%S
2026-03-06 14:25:10
date "+%Y-%m-%d %H:%M:%S"
2026-03-06 14:25:10
backup-%Y-%m-%d-%H-%M-%S.sql
backup-2026-03-06-14-25-10.sql
| Pattern | Example | Use |
|---|---|---|
%Y-%m-%d | 2026-03-06 | Date only |
%Y%m%d | 20260306 | Compact date |
%Y-%m-%d %H:%M:%S | 2026-03-06 14:25:10 | Logs |
%Y%m%d-%H%M%S | 20260306-142510 | Filenames |
