WOOF :: date_format( String $format, Integer $timestamp = null )

Returns:

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. ¬†

Example:

Parameters:

  • String $format

    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.

Latest From the Blog

MasterPress 1.4.1 is now available

27th May 2024

This update addresses backwards compatibility issues that were introduced in the previous update. There were some edge cases where PHP 7 had issues and it didn’t work at all on PHP 5.6. We have now changed it so that the PHP 8 compatibility changes will now only affect PHP 8 and will be more thorough… 

Plugin Requirements

MasterPress requires a minimum of WordPress version 4.9, MySQL 5.6, and PHP version 5.6.20.

We also recommend that PHP is configured to use a memory limit of 64MB per request (128MB may be required for sites with higher complexity).

This plug-in is not compatible with the WordPress.com hosted service.

Three AM