Skip to content

Commit

Permalink
fixed isoformat dates
Browse files Browse the repository at this point in the history
  • Loading branch information
krokicki committed Aug 26, 2024
1 parent a3aa600 commit e657e43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions x2s3/client_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async def head_object(self, key: str):
path = os.path.join(self.root_path, key)
if not os.path.isfile(path):
return get_nosuchkey_response(key)

filename = os.path.basename(path)
headers = {}

Expand Down Expand Up @@ -69,7 +69,7 @@ async def get_object(self, key: str):
path = os.path.join(self.root_path, key)
if not os.path.isfile(path):
return get_nosuchkey_response(key)

filename = os.path.basename(path)
headers = {}

Expand Down
3 changes: 2 additions & 1 deletion x2s3/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from datetime import datetime, timezone
from mimetypes import guess_type

from loguru import logger
from dateutil import parser
from fastapi.responses import Response

Expand Down Expand Up @@ -135,7 +136,7 @@ def format_timestamp_s3(timestamp):
""" Format the given timestamp to ISO date format compatible with AWS S3.
"""
dt = datetime.fromtimestamp(timestamp, tz=timezone.utc)
return f"{dt.isoformat().split('+')[0][:-3]}Z"
return dt.isoformat()


def format_isoformat_as_local(isodate):
Expand Down

0 comments on commit e657e43

Please sign in to comment.