From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 1A05A1F463 for ; Mon, 6 Jan 2020 04:47:52 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] t/nntp.t: fix parse_time test for non-GMT local time Date: Sun, 5 Jan 2020 22:47:52 -0600 Message-Id: <20200106044752.9270-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Yes, there's actually other timezones! --- t/nntp.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/nntp.t b/t/nntp.t index 938eef38..24fe487c 100644 --- 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}//; -- 2.16.5