I have a timestamp that saves a user's last access information like
Time => 14:15:05 PM
Day => 08/23/2023
Based on this saved information, I would like to write a command that returns how much time has passed compared to the time at now 15:15:14 PM on 8/23/2023 as the format below
=> 30 seconds ago
=> 12 minutes ago
=> 4 hours ago
=> 11 days ago
=> 1 year ago
what I've tried so far
date -d '7:00:00 AM - 15 minutes' '+%H:%M'
but this only returns 15 minutes ago based on the prescribed time of 7:00:00 AM an already defined time and decreasing its value to 15 minutes ago.
What I want is to calculate based on the actual time of now (23/08/2023 15:15:14 PM) and say how much time has passed since 14:15:05 on 23/08/2023 or the day before 22/08/2023.