aur: datetime.utcfromtimestamp is deprecated

This commit is contained in:
lilydjwg 2024-05-11 14:02:36 +08:00
parent 5db6a89fc3
commit d49d07437b
1 changed files with 4 additions and 3 deletions

View File

@ -1,7 +1,7 @@
# MIT licensed
# Copyright (c) 2013-2020 lilydjwg <lilydjwg@gmail.com>, et al.
# Copyright (c) 2013-2020,2024 lilydjwg <lilydjwg@gmail.com>, et al.
from datetime import datetime
from datetime import datetime, timezone
import asyncio
from typing import Iterable, Dict, List, Tuple, Any, Optional
@ -95,7 +95,8 @@ async def _run_batch_impl(
version = result['Version']
if use_last_modified:
version += '-' + datetime.utcfromtimestamp(result['LastModified']).strftime('%Y%m%d%H%M%S')
dt = datetime.fromtimestamp(result['LastModified'], timezone.utc)
version += '-' + dt.strftime('%Y%m%d%H%M%S')
if strip_release and '-' in version:
version = version.rsplit('-', 1)[0]