# Ansible date compare

**URL:** <https://forum.ansible.com/t/ansible-date-compare/23631>\
**Category:** Ansible Project\
**Created:** [February 3, 2017, 4:52pm UTC](https://forum.ansible.com/t/ansible-date-compare/23631 "2017-02-03T16:52:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ns273520](https://avatars.discourse-cdn.com/v4/letter/n/2acd7d/32.png) [@ns273520](https://forum.ansible.com/u/ns273520)\
**Post date:** [February 3, 2017, 4:52pm UTC](https://forum.ansible.com/t/ansible-date-compare/23631/1 "2017-02-03T16:52:34Z")

</div>

Hi.

I am new to Ansible and facing some issues with date compare .

Scnerio :-

I have create e2 instances using ansible and i am able to retrieve the launch time of EC2.

- name: launch time and date of EC2  
debug:  
var: “{{instance\_date}}”  
with\_items: “{{ ec2\_facts.instances}}”

Issue i am having is is how do i do math operation of instance\_date with ansible\_date\_time.iso8601\_micro and find the difference .

Any help is appreciated .

Regards,  
NS

---

<div class="post-metadata">

**Author:** ![asmagana](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/asmagana/32/2963_2.png) [@asmagana](https://forum.ansible.com/u/asmagana)\
**Post date:** [April 29, 2019, 10:31pm UTC](https://forum.ansible.com/t/ansible-date-compare/23631/2 "2019-04-29T22:31:12Z")

</div>

Hi There,

Did you have a solution I am looking for something similar.
