I want to get a date-time string in the future, for example I always want to get the next time of 9:00 am.
I know the string formats like "tomorrow" or "next day" to get a certain date-time string. But if I call $(date -d 'tomorrow 09:00')
early in the morning of the Nov. 26 2015, I get Nov 27 09:00:00 2015
. But I would expect to get Nov 26 09:00:00 2015
, because it is the next 9th hour.
How do I get the next occurrence of the 9th hour of a day instead? Are there other key-words like "next occurence of 09:00"?