From: Dirk Eddelbuettel <edd@debian.org>
Date: Aug, 07 2026 21:52:17 -0500
Subject: [PATCH] <short summary of the patch>

Calling Sys.time() makes the build irreproducible so if PKG_BUILT_TIME is given
we prefer it

--- r-base-4.6.1.orig/src/library/tools/man/Rd2HTML.Rd
+++ r-base-4.6.1/src/library/tools/man/Rd2HTML.Rd
@@ -171,11 +171,11 @@ Rd2ex(Rd, out = "", defines = .Platform$
   For example, this man page was:
   \enumerate{
     \item built on
-    \Sexpr[stage=build]{format(Sys.time(), "\%Y-\%m-\%d at \%H:\%M:\%S")},
+    \Sexpr[stage=build]{Sys.getenv("PKG_BUILT_TIME", format(Sys.time(), "\%Y-\%m-\%d at \%H:\%M:\%S"))},
     \item installed on
-    \Sexpr[stage=install]{format(Sys.time(), "\%Y-\%m-\%d at \%H:\%M:\%S")}, and
+    \Sexpr[stage=install]{Sys.getenv("PKG_BUILT_TIME", format(Sys.time(), "\%Y-\%m-\%d at \%H:\%M:\%S"))}, and
     \item rendered on
-    \Sexpr[stage=render]{format(Sys.time(), "\%Y-\%m-\%d at \%H:\%M:\%S")}.
+    \Sexpr[stage=render]{Sys.getenv("PKG_BUILT_TIME", format(Sys.time(), "\%Y-\%m-\%d at \%H:\%M:\%S"))}.
   }
 }
 
