fenom/docs/en/mods/date_format.md
2018-03-15 18:20:44 +03:00

700 B

Modifier date_format

This formats a date and time into the given strftime() format. Dates can be passed to Fenom as unix timestamps, DateTime objects or any string made up of month day year, parsable by strftime(). By default format is: %b %e, %Y.

{var $ts = time()}

{$ts|date_format:"%Y/%m/%d %H:%M:%S"} outputs 2013/02/08 21:01:43
{$ts|date_format:"-1 day"} outputs 2013/02/07 21:01:43

{var $date = "2008-12-08"}

{$ts|date_format:"%Y/%m/%d %H:%M:%S"} outputs 2008/12/08 00:00:00

Allowed quantificators in date_format