Given two times say 2021-06-25T04:04:28Z and 2021-06-18T19:36:31Z where the first time means June 26, 2021 at 4:04am (+28 seconds) and the second time means June 18, 2021 at 7:36pm (+31 seconds). I would like to write a bash script that compares the two times and could tell me if the two events are separated by less than 20 minutes. Is there a function that does this or will I have to try and parse it then do a comparison that way. So for the above input I would like to echo "Times are not within 20 minutes of each other"
Thank you!