Skip to content

Commit 7ae7068

Browse files
Resolve SOURCE_DATE_EPOCH=0 bug.
Not clear to me if... * There may also be a timezone issue here leading to the negative value. And furthermore... * Non-integer values will still raise an exception here. But this does at least resolve the immediate issue.
1 parent 62a4e3c commit 7ae7068

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mkdocs/utils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def get_build_timestamp(*, pages: Collection[Page] | None = None) -> int:
5656
dt = datetime.fromisoformat(date_string)
5757
else:
5858
dt = get_build_datetime()
59-
return int(dt.timestamp())
59+
return max(int(dt.timestamp()), 0)
6060

6161

6262
def get_build_datetime() -> datetime:

0 commit comments

Comments
 (0)