WordPress.org

Ready to get started?Download WordPress

Forums

post_date question (6 posts)

  1. zeekapitein
    Member
    Posted 3 years ago #

    Hi

    I'm using xmlrpc to post remotely to my blog. Does somebody know how to add a custum date when i post it to my blog?(So not the date of now)

    'post_date'=>$pubdate, but i can't make the it to work. I understand you need to use the dateTime.iso8601 format... But no luck... So how set the date of a worpdresspost (remotely).

    I hope you understand my question :)

    Thnx for your help

  2. Joseph Scott
    Member
    Posted 3 years ago #

    I recommend using the date_created_gmt field. This will set the date/time for the post and is always GMT.

  3. zeekapitein
    Member
    Posted 3 years ago #

    Hi thnx Joseph!

    But when i use :

    $pubdate ="2010-07-28 19:36:04";

    then other code of my page :

    $content = array(
    'title'=>$title,
    'description'=>$body,
    'date_created_gmt'=>$pubdate,

    );

    It still doens't work... Is it the wrong format in my variable ? I Now get the error :
    -32700 : parse error. not well formed

    Thnx for your help!

  4. Joseph Scott
    Member
    Posted 3 years ago #

    Sounds like you didn't use dateTime.iso8601 format. Also take a look at the raw XML, often a parse error like that will stand out with a visual inspection.

  5. zeekapitein
    Member
    Posted 3 years ago #

    Thnx I found a working code :p

    $pubdate =strtotime('2009-08-102009-08-31 12:17:25');

    But when i use with :

    'date_created'=>$pubdate,
    'post_date'=>$pubdate,

    'post_modified'=>$pubdate,
    'post_modified_gmt'=>$pubdate,

    I go to my post and the timestamp automaticly changed the date to the current date...

    When i go to my database the date rows (date_created,...) are different from the 'published on' date in my blogpost.... So how do set the published date...

    Thnx for the help! Hope you understan my bad english :p

    greetings

  6. Joseph Scott
    Member
    Posted 3 years ago #

    Stick with the date_created_gmt field.

Topic Closed

This topic has been closed to new replies.

About this Topic