WordPress at Your Fingertips

wp_timezone() WP 1.0

Retrieves the timezone from site settings as a DateTimeZone object.

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

Used By: wp_date()
1 time — 0.0023901 sec (very slow) | 50000 times — 2.04 sec (fast)

No Hooks.

Return

DateTimeZone. Timezone object.

Usage

wp_timezone();

Changelog

Since 5.3.0 Introduced.

Code of wp_timezone() WP 5.8.1

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

date time

No comments
    Log In