date_str
Converts a string timestamp into another date format returned as a string. The format for this syntax is the same as strftime
. date_str
is nearly the same as piping a string to str_to_date then piping the value to date.
Input
Output
Input
Output
date_str
works on unix timestamps.
Input
Output
Input
Output
To get the current time, pass the special word "now"
(or "today"
) to date
.
Input
Output
Note that the value will be the current time of when the page was last generated from the template, not when the page is presented to a user if caching or static site generation is involved.
Last updated