diff --git a/update-zonefile.py b/update-zonefile.py index f2094fb..0f08508 100755 --- a/update-zonefile.py +++ b/update-zonefile.py @@ -24,7 +24,7 @@ import requests from pathlib import Path -from datetime import datetime +from datetime import datetime, timezone import email.utils as eut import os import hashlib @@ -67,7 +67,7 @@ def download_list(url): cache = Path(config['cache'], hashlib.sha1(url.encode()).hexdigest()) if cache.is_file(): - last_modified = datetime.utcfromtimestamp(cache.stat().st_mtime) + last_modified = datetime.fromtimestamp(cache.stat().st_mtime, tz=timezone.utc) headers = { 'If-modified-since': eut.format_datetime(last_modified), 'User-Agent': 'Bind adblock zonfile updater v1.0 (https://github.com/Trellmor/bind-adblock)'