wp_xmlrpc_server::_convert_date() WordPress Method

The wp_xmlrpc_server::_convert_date() method is used to convert a date string into a timestamp. This is used when creating or updating a post via the XML-RPC interface.

wp_xmlrpc_server::_convert_date( string $date ) #

Convert a WordPress date string to an IXR_Date object.


Parameters

$date

(string)(Required)Date string to convert.


Top ↑

Return

(IXR_Date) IXR_Date object.


Top ↑

Source

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

	protected function _convert_date( $date ) {
		if ( '0000-00-00 00:00:00' === $date ) {
			return new IXR_Date( '00000000T00:00:00Z' );
		}
		return new IXR_Date( mysql2date( 'Ymd\TH:i:s', $date, false ) );
	}

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