]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cd2nroff/manage: use UTC when SOURCE_DATE_EPOCH is set
authorDaniel Stenberg <daniel@haxx.se>
Sat, 30 Mar 2024 23:59:55 +0000 (00:59 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 31 Mar 2024 19:25:44 +0000 (21:25 +0200)
Make them independent of the TZ setting. Also set a date string like
YYYY-MM-DD to avoid a local month name in the date.

Reported-by: Carlos Henrique Lima Melara
Fixes #13242
Closes #13243

scripts/cd2nroff
scripts/managen

index b0e702a479d538e92d4a95a82efb14b2e2dd337c..647a28969ec0dbb20708ce5ec8c086f3f73ef9e5 100755 (executable)
@@ -77,11 +77,11 @@ HELP
 use POSIX qw(strftime);
 my @ts;
 if (defined($ENV{SOURCE_DATE_EPOCH})) {
-    @ts = localtime($ENV{SOURCE_DATE_EPOCH});
+    @ts = gmtime($ENV{SOURCE_DATE_EPOCH});
 } else {
     @ts = localtime;
 }
-my $date = strftime "%B %d %Y", @ts;
+my $date = strftime "%Y-%m-%d", @ts;
 
 sub outseealso {
     my (@sa) = @_;
index ab96861b8f7b458cc0ae8748135f5643893aaed8..e5846e64b00b2d3f472dcb0396ed8a81070056e3 100755 (executable)
@@ -50,11 +50,11 @@ my %catlong;
 use POSIX qw(strftime);
 my @ts;
 if (defined($ENV{SOURCE_DATE_EPOCH})) {
-    @ts = localtime($ENV{SOURCE_DATE_EPOCH});
+    @ts = gmtime($ENV{SOURCE_DATE_EPOCH});
 } else {
     @ts = localtime;
 }
-my $date = strftime "%B %d %Y", @ts;
+my $date = strftime "%Y-%m-%d", @ts;
 my $year = strftime "%Y", @ts;
 my $version = "unknown";
 my $globals;