On this page
WP_Customize_Date_Time_Control::format_gmt_offset( float $offset ): string
Format GMT Offset.
Description
See also
Parameters
$offsetfloat Required-
Offset in hours.
Return
string Formatted offset.
Source
File: wp-includes/customize/class-wp-customize-date-time-control.php. View all references
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;
}
Related
Used By
| Used By | Description |
|---|---|
| WP_Customize_Date_Time_Control::get_timezone_info() wp-includes/customize/class-wp-customize-date-time-control.php | Get timezone info. |
Changelog
| Version | Description |
|---|---|
| 4.9.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_customize_date_time_control/format_gmt_offset