تابع ووکامرسی wc_timezone_offset دریافت تفاوت زمانی بر اساس ثانیه

تابع ووکامرسی wc_timezone_offset – دریافت تفاوت زمانی بر اساس ثانیه
Syntax – سینتکس
(float) wc_timezone_offset();
Usage – نحوه استفاده
if ( !function_exists( 'wc_timezone_offset' ) ) {
require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-formatting-functions.php';
}
// NOTICE! Understand what this does before running.
$result = wc_timezone_offset();
Defined – محل تعریف
/includes/wc-formatting-functions.php
function wc_timezone_offset() {
if ( $timezone = get_option( 'timezone_string' ) ) {
$timezone_object = new DateTimeZone( $timezone );
return $timezone_object->getOffset( new DateTime( 'now' ) );
} else {
return floatval( get_option( 'gmt_offset', 0 ) ) * HOUR_IN_SECONDS;
}
}
versions – نسخه ها
از نسخه : 3.0.0
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر