# Ansible Date struggle

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

</div>

Hi I am new to Ansible .

I am some issues working with dates .I want to get the difference between two dates in seconds or minutes .

I created two ec2 instance and was able to retrieve the launch times using below

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

also i was able to get the ansible date using .

- name: launch time and date of EVC and ansible date  
debug:  
date: ansible\_date\_time.iso8601\_micro.date

What i am not able to do is store these variables in a date variable and then subtract them and get this difference .

Could you guys help me ?

Regards,  
NS
