1

I would like to calculate the time for 7am of the next day with the bash. (I want to use it to restart the computer with rtcwake)

According to the man page of date I should use %s to get a unix timestamp. But how do I get if of the next day? (Or 7am of today => add one day)

1 Answer 1

3

Use the -d option

date -d '7:00 tomorrow' +%s

https://www.gnu.org/software/coreutils/manual/coreutils.html#date-invocation
https://www.gnu.org/software/coreutils/manual/coreutils.html#Relative-items-in-date-strings

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .