Calculating time (adding minutes) bash Calculating time (adding minutes) bash bash bash

Calculating time (adding minutes) bash


Try this (Kysu's version):

date -d "16:00 410 minutes" +'%H:%M'

or this:

date -d "16:00 today + 410 minutes" +'%H:%M'

But do not use this:

date -d "16:00 + 410 minutes" +'%H:%M'   # BAD!

Strange things happen if you omit the word today but keep the +. (I think the + 410 is being parsed as a timezone modifier, and then the minutes is interpreted as "add one minute".)