Bugfix: S3 time precision issue fixed (#3182)
* Bugfix: S3 time precision issue fixed * Bugfix: S3 time precision issue fixed * s3 timeformat fix * Quickfix S3 timefix
This commit is contained in:
parent
2504a398f9
commit
c166d97a97
@ -190,6 +190,12 @@ def iso_8601_datetime_without_milliseconds(datetime):
|
|||||||
return None if datetime is None else datetime.strftime("%Y-%m-%dT%H:%M:%S") + "Z"
|
return None if datetime is None else datetime.strftime("%Y-%m-%dT%H:%M:%S") + "Z"
|
||||||
|
|
||||||
|
|
||||||
|
def iso_8601_datetime_without_milliseconds_s3(datetime):
|
||||||
|
return (
|
||||||
|
None if datetime is None else datetime.strftime("%Y-%m-%dT%H:%M:%S.000") + "Z"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
RFC1123 = "%a, %d %b %Y %H:%M:%S GMT"
|
RFC1123 = "%a, %d %b %Y %H:%M:%S GMT"
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ import six
|
|||||||
|
|
||||||
from bisect import insort
|
from bisect import insort
|
||||||
from moto.core import ACCOUNT_ID, BaseBackend, BaseModel
|
from moto.core import ACCOUNT_ID, BaseBackend, BaseModel
|
||||||
from moto.core.utils import iso_8601_datetime_with_milliseconds, rfc_1123_datetime
|
from moto.core.utils import iso_8601_datetime_without_milliseconds_s3, rfc_1123_datetime
|
||||||
from moto.cloudwatch.models import MetricDatum
|
from moto.cloudwatch.models import MetricDatum
|
||||||
from moto.utilities.tagging_service import TaggingService
|
from moto.utilities.tagging_service import TaggingService
|
||||||
from .exceptions import (
|
from .exceptions import (
|
||||||
@ -79,7 +79,7 @@ class FakeDeleteMarker(BaseModel):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def last_modified_ISO8601(self):
|
def last_modified_ISO8601(self):
|
||||||
return iso_8601_datetime_with_milliseconds(self.last_modified)
|
return iso_8601_datetime_without_milliseconds_s3(self.last_modified)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def version_id(self):
|
def version_id(self):
|
||||||
@ -206,7 +206,7 @@ class FakeKey(BaseModel):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def last_modified_ISO8601(self):
|
def last_modified_ISO8601(self):
|
||||||
return iso_8601_datetime_with_milliseconds(self.last_modified)
|
return iso_8601_datetime_without_milliseconds_s3(self.last_modified)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def last_modified_RFC1123(self):
|
def last_modified_RFC1123(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user