date
Converts a timestamp into another date format. Works on strings if they contain well-formatted dates.
Input
-
{{ 'now' | date: ''%Y-%m-%d %H:%M' }}
Output
-
2021-05-21 11:49
Syntax
Syntax | Output | Example |
---|---|---|
%a | Abbreviated weekday | Mon, Tue, Wed ... Sun |
%A | Full weekday name | Monday, Tuesday, Wednesday ... Sunday |
%b | Abbreviated month | Jan, Feb, Mar ... Dec |
%B | Full month name | January, February, March ... December |
%c | Preferred local data and time representation | |
%d | Day of month, zero padded | 01, 02, 03... 31 |
%-d | Day of month, not zero padded | |
%e | Day of month, not zero padded | 1, 2, 3... 31 |
%D | Formats the date | dd/mm/yy |
%F | Formats the date in ISO 8691 format | yyyy-mm-dd |
%H | Hour of the day (24 hour) | 00-23 |
%I | Hour of the day (12 hour) | 1-12 |
%j | Day of the year (Julian) | 001-366 |
%k | Hour of the day (24 hour) | 1-24 |
%m | Month of the year | 01-12 |
%M | Minute of the hour | 00-59 |
%p | Meridian indicator | AM or PM |
%r | 12 hour time | %I:%M:%S %p |
%R | 24 hour time | %H:%M |
%T | 12 hour time | %H:%M:%S |
%U | Number of the week in the year (starting on Sunday) | |
%W | Number of the week in the year (starting on Monday) | |
%x | Formats the date | mm/dd/yy |
%y | Year without the century | 00-99 |
%Y | Year with the century | 2018 |
%Z | Timezone name |