• I’m trying to execute metaWeblog.getRecentPosts against a WP 2.8.4 instance with draft posts. I’m getting an error when attempting to get recent posts using Apache’s XMLRPC library for Java.

    org.apache.xmlrpc.client.XmlRpcClientException: Failed to parse server's response: Failed to parse date value -0001113TT0::0::00 at position 0

    Caused by: java.text.ParseException: Format.parseObject(String) failed
    	at org.apache.xmlrpc.parser.DateParser.setResult(DateParser.java:55)
    	at org.apache.xmlrpc.parser.AtomicParser.endElement(AtomicParser.java:59)

    This problem does not exist in WordPress 2.8. I’ve tracked it down to this difference in xmlrpc.php between 2.8 and 2.8.4 related to handling draft dates:

    // For drafts use the GMT version of the post date
    if ( $postdata['post_status'] == 'draft' ) {
    	$post_date_gmt = get_gmt_from_date( mysql2date( 'Y-m-d H:i:s', $postdata['post_date'] ) );
    	$post_date_gmt = preg_replace( '|\-|', '', $post_date_gmt );
    	$post_date_gmt = preg_replace( '| |', 'T', $post_date_gmt );
    }

    the post_date_gmt column for drafts of new posts is 0000-00-00 00:00:00

The topic ‘reading draft dates with metaWeblog.getRecentPosts via XMLRPC on Java’ is closed to new replies.