Convert fields createdAt and updatedAt of deployment to timestamp
This commit is contained in:
parent
9b535a7c75
commit
3c19f0a02d
2 changed files with 6 additions and 2 deletions
|
|
@ -8,6 +8,7 @@ import boto3
|
|||
import pytz
|
||||
from moto.core.exceptions import JsonRESTError
|
||||
from moto.core import BaseBackend, BaseModel
|
||||
from moto.core.utils import unix_time
|
||||
from moto.ec2 import ec2_backends
|
||||
from copy import copy
|
||||
|
||||
|
|
@ -231,9 +232,9 @@ class Service(BaseObject):
|
|||
|
||||
for deployment in response_object['deployments']:
|
||||
if isinstance(deployment['createdAt'], datetime):
|
||||
deployment['createdAt'] = deployment['createdAt'].isoformat()
|
||||
deployment['createdAt'] = unix_time(deployment['createdAt'].replace(tzinfo=None))
|
||||
if isinstance(deployment['updatedAt'], datetime):
|
||||
deployment['updatedAt'] = deployment['updatedAt'].isoformat()
|
||||
deployment['updatedAt'] = unix_time(deployment['updatedAt'].replace(tzinfo=None))
|
||||
|
||||
return response_object
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue