<div dir="ltr"><br>I'm writing a Java app using the redstone xmlrpc library and having a problem with both postCreated and date_created_gmt<br><br>Whenever I set the postCreated field, WP interprets/modifies the timezone to GMT. For the time being, I've kludged the date (adding the difference between the local TZ and GMT) so that WP gets the post date right.  This is ugly and I'd rather not do this . . .<br>
<br>It's been suggested that I use the date_created_gmt field, but I've had zero luck getting this to work.  It seems that WP cannot parse the passed in java.util.Date as a valid date and subsequently defaults to the current date.<br>
<br>Any thoughts on whats going on here?  Anyone care to share some working code?<br><br>thanks<br><br>tom<br><br><br>Here's a snipet of what I'm doing . . . <br><br><br><span style="font-family: courier new,monospace;">HashMap<String,Object> content = new HashMap<String,Object>();</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">java.util.Date postDate;</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Calendar c = Calendar.getInstance();</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">c.add(Calendar.Days, 7); </span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">postDate = c.getTime();</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">// snip . . . </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">// title, keywords, category, description, etc.  are all populated . . .</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">//</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">content.put("title",title);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">content.put("mt_keywords",keywords);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">content.put("categories", new String[]{category});</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">content.put("post_status", "publish");</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">content.put("description", articlebody);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> //content.put("date_created_gmt",  postDate);</span> <span style="font-family: courier new,monospace;"> // date doesn't get interpretted correctly and defaults to the current date</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">content.put("dateCreated", postDate); // date is offset by local TZ - GMT</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Object[] params = new Object[]{new String("n/a"), user, pass, content, new Boolean("true")};</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> Object token;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">try {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  token = client.invoke("metaWeblog.newPost", params);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">} catch (XmlRpcException ex) {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  Logger.getLogger(WPDripFeederView.class.getName()).log(Level.SEVERE, null, ex);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">} catch (XmlRpcFault ex) {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  Logger.getLogger(WPDripFeederView.class.getName()).log(Level.SEVERE, null, ex);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">}</span><br style="font-family: courier new,monospace;"><br><br><br><br></div>