[wp-xmlrpc] Problems with dateCreated in metaWeblog.newPost/editPost - dateTime.iso8601
aj at cerqueti.co.uk
Mon Nov 2 11:31:51 UTC 2009
Thanks again for your help, Daniel. Realised the PHP function
xmlrpc_encode_request() wasn't returning the datetime member formatted as
below, as it can't take apart an IXR Date object or a Date::ISO8601 object
apart properly, which I'd not anticipated. Assumed it'd check the IXR Date's
asXml() function first, but apparently not. Used SimpleXML to insert the
datetime member node as a separate step.
On Fri, Oct 30, 2009 at 4:24 PM, Daniel Jalkut <jalkut at red-sweater.com>wrote:
> Hi AJ, you should post a copy of what the actual XML cargo looks like that
> gets sent over the network. Otherwise it's harder for the folks on this
> list to speculate what might be wrong.
> For your reference, here is an example of a properly formatted dateTime
> parameter that works:
> When in doubt about these types of things, a great approach is to find a
> client that works, and monitor what it sends over the network, to see what
> you need to mimic.
> On Oct 30, 2009, at 12:17pm, AJ Cerqueti wrote:
>> This has clearly been discussed before:
>> If dateCreated is of PHP type DateTime, posting will succeed, when it's a
>> string in ISO8601 format it fails.
>> However, no matter what date the DateTime object contains, it doesn't seem
>> to pass the timestamp.
>> $title = htmlentities($title,ENT_NOQUOTES,$encoding);
>> $keywords = htmlentities($keywords,ENT_NOQUOTES,$encoding);
>> $datetime = new DateTime('2008-08-03 14:52:10');
>> echo "Formatted ISO: " . $datetime->format(DATE_ISO8601) . "<br />\n";
>> $content = array(
>> 'dateCreated' => $datetime,
>> Will post, but date will be current time.
>> Any ideas?
>> wp-xmlrpc mailing list
>> wp-xmlrpc at lists.automattic.com
> wp-xmlrpc mailing list
> wp-xmlrpc at lists.automattic.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the wp-xmlrpc