Astra_Ext_Advanced_Hooks_Meta::get_wp_timezone_string()

Get the timezone string as selected in wp general setting.


Description


Return

(false|mixed|string|void)


Source

File: addons/advanced-hooks/classes/class-astra-ext-advanced-hooks-meta.php

		public static function get_wp_timezone_string() {

			$current_offset = get_option( 'gmt_offset' );
			$tzstring       = get_option( 'timezone_string' );

			if ( false !== strpos( $tzstring, 'Etc/GMT' ) ) {
				$tzstring = '';
			}

			if ( empty( $tzstring ) ) {
				if ( 0 == $current_offset ) {
					$tzstring = 'UTC+0';
				} elseif ( $current_offset < 0 ) {
					$tzstring = 'UTC' . $current_offset;
				} else {
					$tzstring = 'UTC+' . $current_offset;
				}
			}

			return $tzstring;
		}

User Contributed Notes

You must log in before being able to contribute a note or feedback.