# Ansible date Struggle

**URL:** <https://forum.ansible.com/t/ansible-date-struggle/23624>\
**Category:** Ansible Project\
**Created:** [February 2, 2017, 9:34pm UTC](https://forum.ansible.com/t/ansible-date-struggle/23624 "2017-02-02T21:34:53Z")\
**Posts on this page:** 1\
**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 2, 2017, 9:34pm UTC](https://forum.ansible.com/t/ansible-date-struggle/23624/1 "2017-02-02T21:34:53Z")

</div>

I am new to ansible .

Issue:-

I created 2 ec2 instances successfully and i am able to retrieve the launch\_dates using below .

- name: launch time and date of Ec2  
debug:  
var: item.launch\_time  
with\_items: “{{ ec2\_facts.instances }}”.

I am using below to get ansible date and time

- name: ansible date  
debug:  
var: ansible\_date\_time.iso8601\_micro.date

What i am not able to do is, how do i subtract and get the difference between two date ? (item.launch\_time - ansible\_date\_time.iso8601\_micro.date) and store is to a variable or integer .

Any help is appreciated .

Regards,  
NS
