GC_Customize_Date_Time_Control::format_gmt_offset()
最后更新于:2021-11-27 00:14:17
GC_Customize_Date_Time_Control::format_gmt_offset( float$offset)Format GMT Offset.
参数
- $offset
-
(float) (Required) Offset in hours.
响应
(string) Formatted offset.
源文件
文件: gc-includes/customize/class-gc-customize-date-time-control.php
public function format_gmt_offset( $offset ) {
if ( 0 <= $offset ) {
$formatted_offset = '+' . (string) $offset;
} else {
$formatted_offset = (string) $offset;
}
$formatted_offset = str_replace(
array( '.25', '.5', '.75' ),
array( ':15', ':30', ':45' ),
$formatted_offset
);
return $formatted_offset;
}