Python XMLRPC post.date does not work with Wordpress

21 views Asked by At

I've tried every formatting method I can think of and I cannot get XMLRPC to post.date via python.

I understand xmlrpc.php is looking for iso8601 format, but from xmlrpc.client import DateTime should handle that. I've even tried submitting the exact string of <value><dateTime.iso8601>20231113T00:00:00</dateTime.iso8601></value>

The snippet I am working with is this (i've tried 100 things for formatted_date):

import datetime
import xmlrpc.client

def post_to_wordpress(etc, etc)
    post.title = title
    post.content = content
    post.excerpt = excerpt
    parsed_date = datetime.datetime.strptime(date_str, "%Y-%m-%d")
    formatted_date = f"{date_str.replace('-', '')}T00:00:00"

    post.date = formatted_date
    wp.call(NewPost(post))
0

There are 0 answers