--- url: https://developer.youcan.shop/themes/filters/format/date.md --- # Date Formats a date. The input is a date string, a Unix timestamp, or `now`. The format uses `strftime` directives. ```liquid {{ date | date: format }} ``` ## Example ```liquid {{ '2026-10-05 14:30:00' | date: '%B %e, %Y' }} {{ '2026-10-05 14:30:00' | date: '%Y-%m-%d %H:%M' }} {{ '2026-10-05 14:30:00' | date: '%a %d %b' }} ``` ::: tip Output ```html October 5, 2026 2026-10-05 14:30 Mon 05 Oct ``` ::: ## Directives | Directive | Output | | --------- | ------ | | `%a` | Short weekday name, `Mon` | | `%A` | Full weekday name, `Monday` | | `%d` | Day of the month with a leading zero, `05` | | `%e` | Day of the month, `5` | | `%u` | Day of the week, `1` (Monday) to `7` (Sunday) | | `%w` | Day of the week, `0` (Sunday) to `6` (Saturday) | | `%W` | Week number of the year, `41` | | `%b`, `%h` | Short month name, `Oct` | | `%B` | Full month name, `October` | | `%m` | Month with a leading zero, `10` | | `%y` | Two-digit year, `26` | | `%Y` | Four-digit year, `2026` | | `%D`, `%x` | Date as `10/05/26` | | `%F` | Date as `2026-10-05` | | `%H` | Hour, 24-hour clock, with a leading zero, `14` | | `%k` | Hour, 24-hour clock, `14` | | `%I` | Hour, 12-hour clock, with a leading zero, `02` | | `%l` | Hour, 12-hour clock, `2` | | `%M` | Minutes, `30` | | `%S` | Seconds, `00` | | `%p` | `AM` or `PM` | | `%P` | `am` or `pm` | | `%r` | Time as `02:30:00 PM` | | `%R` | Time as `14:30` | | `%T`, `%X` | Time as `14:30:00` | | `%z` | Time zone offset, `+0000` | | `%Z` | Time zone abbreviation, `UTC` | | `%c` | Date and time as `Mon Oct 5 14:30:00 2026` | | `%s` | Unix timestamp | | `%n` | Line break | | `%t` | Tab | | `%%` | `%` |