wp_timezone

The timeline below displays how wordpress function wp_timezone has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.9

/**
 * Retrieves the timezone of the site as a `DateTimeZone` object.
 *
 * Timezone can be based on a PHP timezone string or a ±HH:MM offset.
 *
 * @since 5.3.0
 *
 * @return DateTimeZone Timezone object.
 */
function wp_timezone()
{
    return new DateTimeZone(wp_timezone_string());
}

WordPress Version: 5.3

/**
 * Retrieves the timezone from site settings as a `DateTimeZone` object.
 *
 * Timezone can be based on a PHP timezone string or a ±HH:MM offset.
 *
 * @since 5.3.0
 *
 * @return DateTimeZone Timezone object.
 */
function wp_timezone()
{
    return new DateTimeZone(wp_timezone_string());
}