]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/nntp.t: fix parse_time test for non-GMT local time
authorEric Wong <e@yhbt.net>
Mon, 6 Jan 2020 04:47:52 +0000 (22:47 -0600)
committerEric Wong <e@yhbt.net>
Mon, 6 Jan 2020 06:14:02 +0000 (06:14 +0000)
Yes, there's actually other timezones!

t/nntp.t

index 938eef385bb5f2b12e3abccd5954d9db183c2f0c..24fe487c3fbec040e0978322194031b1483683dc 100644 (file)
--- a/t/nntp.t
+++ b/t/nntp.t
@@ -68,7 +68,7 @@ use_ok 'PublicInbox::Inbox';
                my ($date, $time, $gmt) = @_;
                my $m = join(' ', @_);
                my $ts = PublicInbox::NNTP::parse_time(@_);
-               my @t = gmtime($ts);
+               my @t = $gmt ? gmtime($ts) : localtime($ts);
                my ($d, $t) = split(' ', strftime('%Y%m%d %H%M%S', @t));
                if (length($date) != 8) { # Net::NNTP uses YYMMDD :<
                        $d =~ s/^[0-9]{2}//;