From 00c0a66d1c2bcb7c236f00397d2734fc78776cc2 Mon Sep 17 00:00:00 2001 From: Bert Blommers Date: Wed, 23 Nov 2022 09:58:34 -0100 Subject: [PATCH] AWSLambda: Modify LastModified-date to correct format (#5702) --- moto/awslambda/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/moto/awslambda/models.py b/moto/awslambda/models.py index 6d5a1eb79..aa468bac0 100644 --- a/moto/awslambda/models.py +++ b/moto/awslambda/models.py @@ -506,7 +506,9 @@ class LambdaFunction(CloudFormationModel, DockerModel): self.region, self.account_id, self.function_name, version ) self.version = version - self.last_modified = datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S") + self.last_modified = datetime.datetime.utcnow().strftime( + "%Y-%m-%dT%H:%M:%S.000+0000" + ) @property def vpc_config(self) -> Dict[str, Any]: # type: ignore[misc] @@ -977,7 +979,7 @@ class FunctionUrlConfig: self.function = function self.config = config self.url = f"https://{random.uuid4().hex}.lambda-url.{function.region}.on.aws" - self.created = datetime.datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S") + self.created = datetime.datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S.000+0000") self.last_modified = self.created def to_dict(self) -> Dict[str, Any]: