Patch for said bug/feature attached. Hope that's ok!
From 34ad5c9ed1923269c1ed78e47449dc3e28a60719 Mon Sep 17 00:00:00 2001
From: Yoav Felberbaum <mrdini@alembic.dreamhost.com>
Date: Fri, 8 Oct 2010 07:21:04 -0700
Subject: [PATCH] Changes for 1.0.4 hopefully
---
lib/DateTime/Format/RFC3339.pm | 2 +-
t/02_formatting.t | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/DateTime/Format/RFC3339.pm b/lib/DateTime/Format/RFC3339.pm
index fadca18..8170972 100644
--- a/lib/DateTime/Format/RFC3339.pm
+++ b/lib/DateTime/Format/RFC3339.pm
@@ -79,7 +79,7 @@ sub format_datetime {
my $mins = int($secs / 60); $secs %= 60;
my $hours = int($mins / 60); $mins %= 60;
++$mins if $secs >= 30;
- $tz = sprintf('%s%02d:%02d', $sign, $hours, $mins);
+ $tz = ($hours == '00' && $mins == '00') ? 'Z' : sprintf('%s%02d:%02d', $sign, $hours, $mins);
}
return
diff --git a/t/02_formatting.t b/t/02_formatting.t
index 9e4d8e1..451b6a3 100644
--- a/t/02_formatting.t
+++ b/t/02_formatting.t
@@ -19,7 +19,7 @@ BEGIN {
],
[
DateTime->new( year => 2002, month => 1, day => 1, hour => 13, minute => 50, second => 5, time_zone => 'Europe/London' ),
- '2002-01-01T13:50:05+00:00',
+ '2002-01-01T13:50:05Z',
],
[
DateTime->new( year => 2002, month => 1, day => 1, hour => 13, minute => 50, second => 5, time_zone => 'America/New_York' ),
--
1.7.1.1