Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to get the date 3 minutes on the future. For example, if "now" is

01-Jan-70 00:00:00 GMT 

I want to get

01-Jan-80 00:03:00 GMT

How should I do it? I'm working with busybox linux.

share|improve this question
I like how it's 3 minutes and 10 years... subtle! – lornix Oct 15 '11 at 11:41
up vote 8 down vote accepted

With GNU date you can do it as simple as this:

date --date="3min"

But busybox seems not so smart (yet). The only reliable solution I came up with using bb is:

busybox date -D '%s' -d "$(( `busybox date +%s`+3*60 ))"

(you don't need the busybox parts if there is no other date implementation present)

If you want a formatted output, you could add this

busybox date -D '%s' +"%y%m%d%H%" -d "$(( `busybox date +%s`+3*60 ))"
share|improve this answer
Unfortunately busybox' implementation of date does not support this nice feature. – michelemarcon Oct 14 '11 at 12:33
Ah, true - I somehow overlooked the part about busybox. Updated now. – rozcietrzewiacz Oct 14 '11 at 13:14
My version of busybox does not support -D; however I have worked around my issue with expr and UTC time. – michelemarcon Oct 14 '11 at 14:26

I had to set the date for +2 hours on busybox OS on my router my command:

date "$(date +%m%d"$(( `date +%H`+2 ))"%M%Y.%S)"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.