Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9000239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:17:10+00:00 2026-06-16T00:17:10+00:00

$content = array( ‘post_title’ => $title, ‘post_content’ => $body, ‘post_status’ => ‘publish’, ‘post_date’ =>

  • 0
    $content = array(
        'post_title' => $title,
        'post_content' => $body,
        'post_status' => 'publish', 
        'post_date' => $pub_date //What's the proper format for the date here?
    )

    $params = array(0,$this->settings['username'],$this->settings['password'],$content);
    $request = xmlrpc_encode_request('wp.newPost',$params);
    $this->Curl->post($this->controller->rpc_url,$request); 

I’ve tried many different variations for post_date format and none of them worked. Here are all the combinations that I’ve already tried and none of them are working:

1) $pub_date = date('Y-m-d H:i:s', time());
2) $pub_date = time();
3) $pub_date = new IXR_Date(time());
4) $pub_date = date('c',time());
5) $datetime = new DateTime('2010-12-30 23:21:46');
   $pub_date = $datetime->format(DateTime::ISO8601);

It seems like I tested every possible solution and it still doesn’t want to post whenever I try to include post_date. Could someone please help, I’m really stuck on this one.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:17:11+00:00Added an answer on June 16, 2026 at 12:17 am

    Figured it out:

      $publish_date = '20121217T01:47:03Z' //this is the proper format for datetime 
      xmlrpc_set_type($publish_date, 'datetime'); //xmlrpc_set_type must be used on above date so that XML passes it properly as <dateTime.iso8601> instead of <string>
    
        $content = array(
            'post_title' => $title,
            'post_content' => $body,
            'post_status' => 'publish', 
            'post_date' => $publish_date);
    
        $params = array(0,$this->settings['username'],$this->settings['password'],$content);
        $request = xmlrpc_encode_request('wp.newPost',$params);
        $this->Curl->post($this->controller->rpc_url,$request); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My content array contains a date field that I'm trying to format as F
I have simple variable $body = array( 'content' => 'content test', 'is_sanitize' => true,
I would like to store different objects in the same controller content array and
I'm trying to find the content of an array on a remote server. All
Here is my code: - (void)loadView { //hard coded array of content for each
im having problems on how to save the content of an array in an
the class, which is content.php class content { private $vars = array(); public function
<?php $url = http://website.com/folder/index.php; $data = array('id' => 'R98s', 'name' => 'Bob', 'content' =>
I need to modify the node content Array before it is rendered into html.
I try to plot a Bar Chart with Core-Plot with an Array (content are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.