Answer the question
In order to leave comments, you need to log in
How to compare dates in BASH?
There is a certain date: 2022-02-19 13:32:09
And there is a local date:
date +%Y-%m-%d\ %H:%M:%S
How to find out how many minutes have passed?
Answer the question
In order to leave comments, you need to log in
d=`date +%s -d '2022-02-19 13:32:09'`
echo $(( (`date +%s` - d) / 60 )) # количество минут от заданного до текущего времени
1. google how to convert a date to a unix timestamp in bash
2. (optional) google how to get the current unix timestamp
3. subtract one from the other, get the difference in seconds
4. how to get minutes from seconds, I really hope you can overpower yourself
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question