diff --git a/moto/kms/responses.py b/moto/kms/responses.py index dc37c8b59..fe7d28523 100644 --- a/moto/kms/responses.py +++ b/moto/kms/responses.py @@ -9,6 +9,7 @@ from boto.exception import JSONResponseError from boto.kms.exceptions import AlreadyExistsException, NotFoundException from moto.core.responses import BaseResponse +from moto.core.utils import iso_8601_datetime_without_milliseconds from .models import kms_backends reserved_aliases = [ @@ -272,7 +273,7 @@ class KmsResponse(BaseResponse): try: return json.dumps({ 'KeyId': key_id, - 'DeletionDate': self.kms_backend.schedule_key_deletion(key_id) + 'DeletionDate': iso_8601_datetime_without_milliseconds(self.kms_backend.schedule_key_deletion(key_id)) }) except KeyError: raise JSONResponseError(404, 'Not Found', body={