Skip to content

Commit

Permalink
Parse unknown timezones as UTC (#1047)
Browse files Browse the repository at this point in the history
Without this change, parsing changelog entries such as
Tue Mar 28 07:25:39 WEST 2017 - someone@suse

would produce a Mar 27 date in the .spec file, because

TZ=CET perl -e 'use Date::Parse; print str2time("28 Mar 2017")'
1490652000

considers the local timezone and maps to

date -d @1490652000 -u -Iseconds
2017-03-27T22:00:00+00:00

This patch was done while working on reproducible builds for openSUSE.
  • Loading branch information
bmwiedemann authored Jan 7, 2025
1 parent b4ce84e commit fd54fad
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions changelog2spec
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ use Time::Zone;

use strict;

$ENV{TZ} = "UTC";
my @wday = qw{Sun Mon Tue Wed Thu Fri Sat};
my @mon = qw{Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec};

Expand Down

0 comments on commit fd54fad

Please sign in to comment.