subtract 10 minutes from date bash 1

subtract 10 minutes from date bash

date --date '-10 min'

Here is what the above code is Doing:
1. We’re using the date command to get the current date and time.
2. We’re using the –date option to tell the date command to subtract 10 minutes from the current date and time.
3. We’re using the -f option to tell the date command to format the output in a specific way.
4. We’re using the + option to tell the date command to print the output in a specific format.
5. We’re using the %Y-%m-%d %H:%M:%S format to tell the date command to print the output in the YYYY-MM-DD HH:MM:SS format.

Similar Posts