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.
Return
(DateTimeZone) Timezone object.
Source
File: wp-includes/functions.php
function wp_timezone() { return new DateTimeZone( wp_timezone_string() ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
5.3.0 | Introduced. |