Reference › Functions wp_timezone (): DateTimeZone
Since 5.3.0
Source wp-includes/functions.php:152Description Return Uses Used by Source History 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. Used by · 10 WP_Date_Query::build_mysql_datetime() Builds a MySQL format date/time based on some query parameters. current_datetime() Retrieves the current time as an object using the site's timezone. current_time() Retrieves the current time based on specified type. date_i18n() Retrieves the date in localized format, based on a sum of Unix timestamp and timezone offset in seconds. get_date_from_gmt() Given a date in UTC or GMT timezone, returns that date in the timezone of the site. get_gmt_from_date() Given a date in the timezone of the site, returns that date in UTC. get_post_datetime() Retrieves post published or modified time as a `DateTimeImmutable` object instance. iso8601_to_datetime() Given an ISO 8601 (Ymd\TH:i:sO) date, returns a MySQL DateTime (Y-m-d H:i:s) format used by post_date[_gmt]. mysql2date() Converts given MySQL date string into a different format. wp_date() Retrieves the date, in localized format. History Introduced in 5.3.0 . Unchanged from 6.7.7 through 7.1.0.
6.7.7 6.8.8 6.9.7 7.0.4 7.1.0 Signature, return type and hooks compared across 5 parsed releases.
About this page Parsed data Generated from the wordpress-develop 6.9.7 tag, from src/wp-includes/functions.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. Corrections Something wrong on this page? Report it and it gets fixed in the next regeneration.