diff --git a/warcio/recordbuilder.py b/warcio/recordbuilder.py index ca3c0890..a8655b3b 100644 --- a/warcio/recordbuilder.py +++ b/warcio/recordbuilder.py @@ -1,7 +1,7 @@ -import datetime import six import tempfile +from datetime import datetime, timezone from io import BytesIO from warcio.recordloader import ArcWarcRecord, ArcWarcRecordLoader @@ -153,7 +153,7 @@ def _make_warc_id(cls): @classmethod def _make_warc_date(cls, use_micros=False): - return datetime_to_iso_date(datetime.datetime.utcnow(), use_micros=use_micros) + return datetime_to_iso_date(datetime.now(timezone.utc), use_micros=use_micros) def ensure_digest(self, record, block=True, payload=True): if block: