ActionScheduler_TimezoneHelper::get_local_timezone_offset()protected staticWC 2.1.0

Get timezone offset in seconds.

Method of the class: ActionScheduler_TimezoneHelper{}

No Hooks.

Return

float.

Usage

$result = ActionScheduler_TimezoneHelper::get_local_timezone_offset();

Changelog

Since 2.1.0 Introduced.

ActionScheduler_TimezoneHelper::get_local_timezone_offset() code WC 9.3.3

protected static function get_local_timezone_offset() {
	$timezone = get_option( 'timezone_string' );

	if ( $timezone ) {
		$timezone_object = new DateTimeZone( $timezone );
		return $timezone_object->getOffset( new DateTime( 'now' ) );
	} else {
		return floatval( get_option( 'gmt_offset', 0 ) ) * HOUR_IN_SECONDS;
	}
}