ecto
desktop blogging
endo
total aggregation
1001
flickr accessory

Time-travelling

Mon, 2008-01-14

Time-travelling

You're a blogger and you're hanging out in Tokyo. You have 3 blogs, each in the US. All your blogs are set to GMT-7, but your Mac is in GMT+8. What is the best way to configure ecto?

It all depends on what systems powers your blogs. I've written before about how desktop blog clients talk to blog systems. It's all about sending text formatted as XML over simple HTTP. There's a specific way to format dates so both blog system and blog client can read it, the ISO8601 format. For example, 2008-01-12T13:09Z gives date and time (separated by a 'T'). The 'Z' suffix means that the date is in GMT.

The Atom publishing protocol gets this right. It requires that dates sent and received specify the timezone. There's no need to configure ecto as it knows Atom is a good boy. The problem is with XML-RPC. It does not have that requirement, and each blog system interprets dates differently.

The cheap way out for a blog client to talk to a blog system using XML-RPC is not to specify a date so that the blog system will use the current date and time. That does not always work. When sending an edit of an already published blog post the date will reset to current. In addition, sometimes the user may want to specify a different date for a post. In those cases, the lack of timezone information in the XML transferred can lead to unwanted time offsets.

Some blog systems, like MovableType, parse ISO8601 dates with the Z suffix correctly, but still return dates without a timezone specification. In those cases, ecto needs to be told what timezone the blog is in. WordPress, on the other hand, has a custom field for GMT dates, so does not need special handling.

I ran into trouble with TextPattern, though, and have not been able to work around it elegantly. I looked in the xmlrpc.php file of TextPattern and it not only ignores the timezone suffix of the received date (in this case, 'Z'), it also adjusts the date by the offset of the blog's timezone from GMT. If the server hosting TextPattern is set to a different timezone, that offset is also included. The only work-around is to send dates without a GMT specification and ignore any errors ecto pops up about mismatched dates. It's an issue for TextPattern to fix.