]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-121871: Allow overriding docs build date with SOURCE_DATE_EPOCH (#121872)
authorBernhard M. Wiedemann <bwiedemann@suse.de>
Wed, 17 Jul 2024 05:34:00 +0000 (07:34 +0200)
committerGitHub <noreply@github.com>
Wed, 17 Jul 2024 05:34:00 +0000 (23:34 -0600)
Doc/conf.py

index 29b1b2db32718b6fc89f61d38a7215cdb2917f12..6ab8e8ccbdfd96c55974c9da6a14f56343846581 100644 (file)
@@ -347,7 +347,8 @@ html_context = {
 }
 
 # This 'Last updated on:' timestamp is inserted at the bottom of every page.
-html_last_updated_fmt = time.strftime('%b %d, %Y (%H:%M UTC)', time.gmtime())
+html_time = int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
+html_last_updated_fmt = time.strftime('%b %d, %Y (%H:%M UTC)', time.gmtime(html_time))
 
 # Path to find HTML templates.
 templates_path = ['tools/templates']