WordPress at a glance
function is not described

WP_Customize_Date_Time_Control::format_gmt_offset() public WP 4.9.0

Format GMT Offset.

{} It's a method of the class: WP_Customize_Date_Time_Control{}

No Hooks.

Return

String. Formatted offset.

Usage

$WP_Customize_Date_Time_Control = new WP_Customize_Date_Time_Control();
$WP_Customize_Date_Time_Control->format_gmt_offset( $offset );
$offset(float) (required)
Offset in hours.

Notes

  • See: wp_timezone_choice()

Changelog

Since 4.9.0 Introduced.

Code of WP_Customize_Date_Time_Control::format_gmt_offset() WP 5.7.2

<?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;
}