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

Returns:

A synonym of the [method cls=”woof” name=”date-format” method 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.3.10 is now available

9th November 2023

MasterPress 1.3.10 is a feature and bugfix release. Workaround for fatal error introduced by changes to WordPress’ wpdb class in WordPress 6.4. Added actions to MPC files upload_field & WF image save_image functions.

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