I am getting a timestamp for my search and I am converting it using the command date -d@<timestamp> +"%F %H:%M:%S
. It is providing me the Date and Time correctly, i.e. yyyy-mm-dd H:M:S format but I need to find the time difference (in minutes) between the date-time obtained from timestamp and the current date-time.
Use
date +%s
to obtain the current time as a timestamp (seconds from THE EPOCH). Since a unix timestamp is simply a number (of seconds since 1970), you can subtract the two timestamps and divide by 60 to obtain minutes.
If your date command does not support %s, then Biffen comment is helpful.