wp_timezone() WordPress Function

The wp_timezone() function is used to retrieve the current timezone for a WordPress site. This function takes no parameters.

wp_timezone() #

Retrieves the timezone of the site as a DateTimeZone object.


Description

Timezone can be based on a PHP timezone string or a ±HH:MM offset.


Top ↑

Return

(DateTimeZone) Timezone object.


Top ↑

Source

File: wp-includes/functions.php

function wp_timezone() {
	return new DateTimeZone( wp_timezone_string() );
}


Top ↑

Changelog

Changelog
VersionDescription
5.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by the Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More