there is a way to compare between the current time using ansible_date_time
with another date (aws ec2 launch time) So I will be able to know if it happened in the last hour?
I have the following var ec2_launch_time: 2018-01-04T15:57:52+00:00
I know that I can compare days with the following method (from here and here):
"{{ (ansible_date_time.iso8601[:19] | to_datetime('%Y-%m-%dT%H:%M:%S') - ec2_launch_time[:19] | to_datetime('%Y-%m-%dT%H:%M:%S')).days }}"
if I will get 0 I will know that it happened on the same day but I'm looking for a way to get true or false if the difference between the dates are 1 hour (on the same day).
there is a filter for this or elegant way to write this or only using shell (like this)?