diff --git a/anymail/backends/base.py b/anymail/backends/base.py index 0168fe12..87bbf1e2 100644 --- a/anymail/backends/base.py +++ b/anymail/backends/base.py @@ -462,7 +462,7 @@ def aware_datetime(self, value): dt = datetime(value.year, value.month, value.day) # naive, midnight else: try: - dt = datetime.utcfromtimestamp(value).replace(tzinfo=timezone.utc) + dt = datetime.fromtimestamp(value, timezone.utc) except (TypeError, ValueError): return value if is_naive(dt):