wp_timezone_override_offset

Definition:
function wp_timezone_override_offset() {}

gmt_offset modification for smart timezone handling.
Overrides the gmt_offset option if we have a timezone_string available.

Source code

function wp_timezone_override_offset() {

	if ( !$timezone_string = get_option( 'timezone_string' ) ) {

		return false;

	}



	$timezone_object = timezone_open( $timezone_string );

	$datetime_object = date_create();

	if ( false === $timezone_object || false === $datetime_object ) {

		return false;

	}

	return round( timezone_offset_get( $timezone_object, $datetime_object ) / 3600, 2 );

}

4169

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: