Ansible Date struggle

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