WP_Customize_Date_Time_Control::format_gmt_offset

Advertisement

Summery Summery

Format GMT Offset.

Syntax Syntax

WP_Customize_Date_Time_Control::format_gmt_offset( float $offset )

Parameters Parameters

$offset

(float) (Required) Offset in hours.

Return Return

(string) Formatted offset.

Source Source

File: wp-includes/customize/class-wp-customize-date-time-control.php

	 * @return string Formatted offset.
	 */
	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
		);

Advertisement

Changelog Changelog

Changelog
Version Description
4.9.0 Introduced.

See also See also

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.