WOOF :: date_format( String $format, Integer $timestamp = null )
An extension of PHP’s date function to format date timestamps. In addition to the formatting characters supported by date, this function allows more memorable tokens to be used.
Parameters:
-
A format string that supports the same formatting characters as the PHP date function, but also the following tokens inside square brackets: (shows the equivalent formatting string in PHP date).
- [date-time-long] => “l, jS F Y @ g:i A”,
- [date-time-sortable-no-sec] => “YmdHi”,
- [date-time-sortable] => “YmdHis”,
- [day-0s] => ‘d’,
- [0-day] => ‘d’,
- [day-short] => ‘D’,
- [day] => ‘j’,
- [date] => ‘j’,
- [date-suffix] => ‘jS’,
- [day-long] => ‘l’,
- [week] => ‘N’,
- [suffix] => ‘S’,
- [day-of-week] => ‘w’,
- [day-of-year] => ‘z’,
- [week-of-year] => ‘W’,
- [month-long] => ‘F’,
- [month-0s] => ‘m’,
- [0-month] => ‘m’,
- [month-short] => ‘M’,
- [month] => ‘n’,
- [days-in-month] => ‘t’,
- [leap] => ‘L’,
- [year-iso] => ‘o’,
- 2024 => ‘Y’,
- [year-short] => ‘y’,
- [am-pm] => ‘a’,
- [AM-PM] => ‘A’,
- [ampm] => ‘a’,
- [AMPM] => ‘A’,
- [swatch] => ‘B’,
- [hour] => ‘g’,
- [hour-24] => ‘G’,
- [hour-0s] => ‘h’,
- [0-hour] => ‘h’,
- [hour-24-0s] => ‘H’,
- [0-hour-24] => ‘H’,
- [min] => ‘i’,
- [min-0s] => ‘i’,
- [0-min] => ‘i’,
- [sec] => ‘s’,
- [sec-0s] => ‘s’,
- [0-sec] => ‘s’,
- [micro] => ‘u’,
- [timezone] => ‘e’,
- [daylight-savings] => ‘I’,
- [gmt-offset] => ‘O’,
- [gmt-offset-colon] => ‘P’,
- [timezone-short] => ‘T’,
- [timezone-offset] => ‘Z’
-
Integer $timestamp = null
A timestamp to format. If this is not provided, the current date and time will be used.