diff options
Diffstat (limited to 'lv2specgen')
-rwxr-xr-x | lv2specgen/lv2specgen.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py index 11647f2..38594fb 100755 --- a/lv2specgen/lv2specgen.py +++ b/lv2specgen/lv2specgen.py @@ -46,6 +46,7 @@ import optparse import os import re import sys +import time import xml.sax.saxutils import xml.dom import xml.dom.minidom @@ -1374,8 +1375,10 @@ def specgen(specloc, indir, style_uri, docdir, tags, opts, instances=False, root else: template = template.replace('@COMMENT@', '') - template = template.replace('@DATE@', datetime.datetime.utcnow().strftime('%F')) - template = template.replace('@TIME@', datetime.datetime.utcnow().strftime('%F %H:%M UTC')) + now = int(os.environ.get('SOURCE_DATE_EPOCH', time.time())) + build_date = datetime.datetime.utcfromtimestamp(now) + template = template.replace('@DATE@', build_date.strftime('%F')) + template = template.replace('@TIME@', build_date.strftime('%F %H:%M UTC')) # Write index row if index_path is not None: |