hadley/lubridate — pull request #143 by ijlyttle (2012-11-26 16:22:44+00:00)
Title: support for ISO-8601-formatted instants

Three functions are offered: `ymd_hms_z`, `ymd_hms_o`, and `helper_offset`.

`ymd_hms_z` is used to process strings like `"2012-03-04T05:06:07Z"`. It is a simple wrapper to `ymd_hms`; it passes the string to `ymd_hms` and sets the timezone to UTC.

`ymd_hms_o` is used to process strings like `"2012-03-04T05:06:07+00:00"`. It is also a wrapper to `ymd_hms`, but less simple; it parses the trailing offset, applies it to the instant, and sets the timezone to UTC.

Formatting output does not appear to be one of the purposes of lubridate, so I am trying very hard not to suggest feature creep.

To format a date-time to appear as `"2012-03-04T05:06:07-05:00"` using the timezone of the instant does require a bit of effort, so the function `helper_offset`, is offered.

Also, some tests are included.

There are doubtless better and more subtle ways to accomplish these goals. My only purpose is to suggest *a* way.