From 73452c79f7b7b6ac79459a8e5cbd9cb3994f7273 Mon Sep 17 00:00:00 2001 From: Steve Pulec Date: Mon, 2 Nov 2015 23:33:39 -0500 Subject: [PATCH] Add milliseconds to EC2 launch time. Closes #445. --- moto/ec2/models.py | 2 +- tests/test_ec2/test_instances.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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