Make WordPress Core

Opened 19 years ago

Closed 16 years ago

Last modified 10 years ago

#1633 closed defect (bug) (wontfix)

XML-RPC does not return time zone in ISO8601 date

Reported by: pidge's profile pidge Owned by:
Milestone: Priority: high
Severity: normal Version: 2.5.1
Component: XML-RPC Keywords: xml-rpc ISO8601 UTC
Focuses: Cc:

Description

When retrieving recent posts using the xml-rpc metaWeblog.getRecentPosts method, the post's dateCreated attribute returns a properly formatted ISO 8601 date, however, it is always returned as a local date time stamp. The local date is based on WP time zone setting.

For example, if the time zone set on WP is UTC-7 hours (PST, August), and if the entry post date is shown as "8/26 8.30 AM PST", the getRecentPost call via xml-rpc returns the value of "20050826T08:30:00". Note this the local time (PST). WP should return UTC time with the time zone. E.g. "20050826T15:30:00Z".

Note: Posting of new entries via xml-rpc works correctly. For example, if I send "20050826T15:30:00Z" as the entry creation time during a new post (metaWeblog.newPost call), then WP publishes this correctly as "8/26 8.30 AM PST".

The ISO 8601 dates should be returned with the time zone - similar to time stamps in Atom (feed).

This applies to WP 1.5, 1.5.1.3 and 1.5.2.

Change History (5)

#1 @johnbillion
17 years ago

Can anyone confirm this bug still exists?

#2 @foolswisdom
17 years ago

  • Resolution set to worksforme
  • Status changed from new to closed

Closing as WORKSFORME without validating. Please reopen if still an issue.

#3 @cfinke
16 years ago

  • Priority changed from normal to high
  • Resolution worksforme deleted
  • Status changed from closed to reopened
  • Version changed from 1.5.2 to 2.5.1

Yes, this bug still exists in Wordpress 2.5.1. This is the code used to generate the iso8601.dateTime component of XMLRPC responses in wp-includes/class-IXR.php (line 634):

return $this->year.$this->month.$this->day.'T'.$this->hour.':'.$this->minute.':'.$this->second.$this->timezone;

Notice that it does reference a timezone at the end, but the value of $this->timezone is always empty.

It's very important that this bug gets fixed, as it's causing lots of problems for ScribeFire users.

#4 @josephscott
16 years ago

  • Resolution set to wontfix
  • Status changed from reopened to closed

Unfortunately we've found that some clients are extremely sensitive to the contents of the dateCreated field. To the extent even that adding time zone info will actually break some of them.

What we ended up doing is adding a new field, date_created_gmt, that is always GMT by definition, even if there is no time zone info provided.

If you are interested in XML-RPC features/issues/etc then I recommend joining the wp-xmlrpc email list:

http://lists.automattic.com/mailman/listinfo/wp-xmlrpc

This is where this exact date issue has hashed out (along with tickets/patches here in Trac).

This ticket was mentioned in IRC in #wordpress-dev by Matth_eu. View the logs.


10 years ago

Note: See TracTickets for help on using tickets.