wp_xmlrpc_server::_convert_date_gmt() WordPress Method

The wp_xmlrpc_server::_convert_date_gmt() method is used to convert a date string from GMT to the local timezone. This is useful for dates that are displayed in the WordPress admin interface, which are displayed in GMT by default.

wp_xmlrpc_server::_convert_date_gmt( string $date_gmt, string $date ) #

Convert a WordPress GMT date string to an IXR_Date object.


Parameters

$date_gmt

(string)(Required)WordPress GMT date string.

$date

(string)(Required)Date string.


Top ↑

Return

(IXR_Date) IXR_Date object.


Top ↑

Source

File: wp-includes/class-wp-xmlrpc-server.php

	protected function _convert_date_gmt( $date_gmt, $date ) {
		if ( '0000-00-00 00:00:00' !== $date && '0000-00-00 00:00:00' === $date_gmt ) {
			return new IXR_Date( get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $date, false ), 'Ymd\TH:i:s' ) );
		}
		return $this->_convert_date( $date_gmt );
	}

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More