Title: Please help/Getting Date
Last modified: August 19, 2016

---

# Please help/Getting Date

 *  [wordpresshelp111](https://wordpress.org/support/users/wordpresshelp111/)
 * (@wordpresshelp111)
 * [17 years ago](https://wordpress.org/support/topic/please-helpgetting-date/)
 * Hi,
 * Please help with this. I am trying to use the XMLRPC to create a post, but cannot
   figure out how to pass a “dateCreated”.
 * I.e.,
 * $content[‘date_created_gmt’] = date(“Ydm”);
    or $content[‘postDate’] = date(“
   Ydm”); $client->query(‘metaWebLog.newPost’…etc,etc)
 * Basically, if I try executing that, I get this error (it is calling the xmlrpc.
   php installed by default in wordpress)
 * “An error occured – 32700: parse error, not well formed”
 * Any help would be GREATLY appreciated.
 * Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [Joseph Scott](https://wordpress.org/support/users/josephscott/)
 * (@josephscott)
 * [17 years ago](https://wordpress.org/support/topic/please-helpgetting-date/#post-1038365)
 * Hard to tell exactly what the parse error was without seeing the raw XML, but
   a few things to note:
 * – Highly recommend using the date_created_gmt field, which is by definition always
   GMT.
    – Remember that date fields are <dateTime.iso8601> ([http://www.xmlrpc.com/spec](http://www.xmlrpc.com/spec))–
   The method name is metaWeblog.newPost (note the character case)
 *  Thread Starter [wordpresshelp111](https://wordpress.org/support/users/wordpresshelp111/)
 * (@wordpresshelp111)
 * [17 years ago](https://wordpress.org/support/topic/please-helpgetting-date/#post-1038497)
 * Ok…
 * **How** do I format the date field correctly then?
 * I am trying to use:
 * $content[“date_created_gmt”]=’2010-08-08 00:00:00′
 * as a test, and it doesn’t work. I have tried sticking a ‘gmdate(…)’ in front 
   of that, still doesn’t work.
 * All my other fields (so far) work ok if I make changes, so no idea about this.
   I have tried “manually” making a iso8601 string, but that doesn’t work either.
 * Is there some ‘special’ wordpress way of formatting a date? As it is, I am having
   to manually rewrite this via SQL…
 *  [Joseph Scott](https://wordpress.org/support/users/josephscott/)
 * (@josephscott)
 * [17 years ago](https://wordpress.org/support/topic/please-helpgetting-date/#post-1038509)
 * If you are using the IXR XML-RPC library ([http://scripts.incutio.com/xmlrpc/](http://scripts.incutio.com/xmlrpc/)),
   which is the one that WordPress ships with and uses, then you’ll need to call
   IXR_Date class. Something like this:
 * `$content['date_created_gmt'] = new IXR_Date( $post_date_time );`
 * This allows will make the contents of that field use the dateTime.iso8601 XML-
   RPC data type.
 *  [asechrest](https://wordpress.org/support/users/asechrest/)
 * (@asechrest)
 * [17 years ago](https://wordpress.org/support/topic/please-helpgetting-date/#post-1038516)
 * Totally off-topic comment. I read the title of this post as “please help getting
   a date.” Thought I had wandered into an internet dating forum. =D
 * Ok, carry on.
 *  Thread Starter [wordpresshelp111](https://wordpress.org/support/users/wordpresshelp111/)
 * (@wordpresshelp111)
 * [17 years ago](https://wordpress.org/support/topic/please-helpgetting-date/#post-1038572)
 * Hi j. scott,
 * Thanks!! That did the trick… How did you figure that out/know about it? Have 
   you just done a lot of xmlrpc work? (I tried searching the wordpress docs, probably
   spent about 4-5 hours just to find *one* line of code :P)
 * Where would you recommend further reading? (for anything xmlrpc related, but 
   helping with wordpress?)
 * Thanks very much! 🙂
 *  [Joseph Scott](https://wordpress.org/support/users/josephscott/)
 * (@josephscott)
 * [17 years ago](https://wordpress.org/support/topic/please-helpgetting-date/#post-1038593)
 * I do a fair bit of XML-RPC work on WP. There’s an email list:
 * [http://lists.automattic.com/mailman/listinfo/wp-xmlrpc](http://lists.automattic.com/mailman/listinfo/wp-xmlrpc)
 * Which is good to join if you are going to be doing WP XML-RPC (or AtomPub) work.
   If xmlrpc.com comes back again there was a fair bit of content on there (seems
   to be gone/down right now). I believe there are a few books around as well.
 *  [attuk](https://wordpress.org/support/users/attuk/)
 * (@attuk)
 * [16 years ago](https://wordpress.org/support/topic/please-helpgetting-date/#post-1038672)
 * Hi Scott,
    Would IXR XML-RPC library the best to use for xmlrpc ? I am struggling
   to encode dateCreated in ISO in php using date(“c”) etc, I am thinking of using
   a library to make life easier. BTW, I read your reply on [http://wordpress.org/support/topic/330597](http://wordpress.org/support/topic/330597)
   Thanks for any advice.
 *  [Joseph Scott](https://wordpress.org/support/users/josephscott/)
 * (@josephscott)
 * [16 years ago](https://wordpress.org/support/topic/please-helpgetting-date/#post-1038673)
 * I like the IXR library.
 * For date fields, make sure you are setting the field as a date type in the XML-
   RPC request.
 *  [attuk](https://wordpress.org/support/users/attuk/)
 * (@attuk)
 * [16 years ago](https://wordpress.org/support/topic/please-helpgetting-date/#post-1038674)
 * Thanks I am using IXR now and it’s much easier !

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Please help/Getting Date’ is closed to new replies.

## Tags

 * [date](https://wordpress.org/support/topic-tag/date/)
 * [xmlrpc](https://wordpress.org/support/topic-tag/xmlrpc/)

 * 9 replies
 * 4 participants
 * Last reply from: [attuk](https://wordpress.org/support/users/attuk/)
 * Last activity: [16 years ago](https://wordpress.org/support/topic/please-helpgetting-date/#post-1038674)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
