tow/sunburnt — pull request #47 by rboulton (2012-04-04 14:26:49+00:00)
Title: Fix handling of dates.

Various tests, and untested cases, have been failing since #39 was
merged. This patch fixes the following:

mx.DateTime dates were failing with AttributeError due to not having an
isotime method. To fix this, we check for the isotime attribute before
using it.

handling of dates with timezones attached was failing; the 00:00 from
the timezone was being included in the output, making them invalid
(particularly when the Z was appended). To fix this, we remove the
timezone information after using pytz to force the timezone to be UTC.

handling of datetime objects with millisecond values was failing, since
isotime() includes the millisecond component if it is non-0, and
therefore the millisecond value was being output twice. To fix this, we
just use the raw isotime() output (but append the Z).