mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Force last update datetime value to always be UTC
- If SOURCE_DATE_EPOCH is set in the environment, then the build date will use UTC as the timezone. - If it's not set in the environment, we should do the same thing and use UTC as the timezone for the build date. - `datetime.now()` produces a naive system-time datetime object; `datetime.utcnow()` produces the aware, UTC-oriented datetime object.
This commit is contained in:
@@ -286,7 +286,7 @@ def format_date(format, date=None, language=None):
|
||||
if source_date_epoch is not None:
|
||||
date = datetime.utcfromtimestamp(float(source_date_epoch))
|
||||
else:
|
||||
date = datetime.now()
|
||||
date = datetime.utcnow()
|
||||
|
||||
result = []
|
||||
tokens = date_format_re.split(format)
|
||||
|
||||
Reference in New Issue
Block a user