]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-121871: Allow overriding docs build date with SOURCE_DATE_EPOCH (GH-121872...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 17 Jul 2024 06:19:09 +0000 (08:19 +0200)
committerGitHub <noreply@github.com>
Wed, 17 Jul 2024 06:19:09 +0000 (00:19 -0600)
Co-authored-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
Doc/conf.py

index cf21ea97e7110063456d1414a653be6b23c9f00f..3db65df7a84b2152fe0cde3deca3cd3f9e05e08e 100644 (file)
@@ -331,7 +331,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']