関数 wp_timezone_override_offset()
定義ファイル :/blog/wp-includes/functions.php 19
wp_timezone_override_offset()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | /** * gmt_offset modification for smart timezone handling. * * Overrides the gmt_offset option if we have a timezone_string available. * * @since 2.8.0 * * @return float|bool Timezone GMT offset, false otherwise. */ 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 ) / HOUR_IN_SECONDS, 2 ); } |