Subject: | AnyEvent::XMPP::Util: $ENV{TZ} should not include a space after UTC |
I'm getting a test failure:
t/datetime.t ............... 1/22
# Failed test 'timestamp is UTC located'
# at t/datetime.t line 31.
# got: '1185821500'
# expected: '1185813700'
# Looks like you failed 1 test of 22.
$ENV{TZ} get set to "UTC -2:10". I think that should be "UTC-02:10".
The test passes with the following patch applied:
diff --git a/lib/AnyEvent/XMPP/Util.pm b/lib/AnyEvent/XMPP/Util.pm
index 7faae05..7d9bc92 100644
--- a/lib/AnyEvent/XMPP/Util.pm
+++ b/lib/AnyEvent/XMPP/Util.pm
@@ -519,7 +519,7 @@ sub xmpp_datetime_as_timestamp {
my ($s, $m, $h, $md, $mon, $year, $tz) = from_xmpp_datetime ($string);
my $otz = $ENV{TZ};
- $ENV{TZ} = ($tz =~ /^([+-])(\d{2}):(\d{2})$/ ? "UTC $tz" : "");
+ $ENV{TZ} = ($tz =~ /^([+-])(\d{2}):(\d{2})$/ ? "UTC$tz" : "");
POSIX::tzset ();
my $ts = POSIX::mktime ($s, $m, $h, $md, $mon, $year);