diff --git a/moto/ec2/models.py b/moto/ec2/models.py index a7c0133c7..0a2c3ffb7 100644 --- a/moto/ec2/models.py +++ b/moto/ec2/models.py @@ -98,7 +98,7 @@ from .utils import ( def utc_date_and_time(): - return datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%SZ') + return datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S.000Z') def validate_resource_ids(resource_ids): diff --git a/tests/test_ec2/test_instances.py b/tests/test_ec2/test_instances.py index 629fc67ee..2e9b9834a 100644 --- a/tests/test_ec2/test_instances.py +++ b/tests/test_ec2/test_instances.py @@ -53,7 +53,7 @@ def test_instance_launch_and_terminate(): instances.should.have.length_of(1) instances[0].id.should.equal(instance.id) instances[0].state.should.equal('running') - instances[0].launch_time.should.equal("2014-01-01T05:00:00Z") + instances[0].launch_time.should.equal("2014-01-01T05:00:00.000Z") instances[0].vpc_id.should.equal(None) root_device_name = instances[0].root_device_name