You can use the integer division and multiply back to get the round value.
$ m=23 $ (( m /= 5, m *= 5 )) && echo $m 20
Integer division just return the integer part of the result, so in the case above is returning 4. Then multiplying by 5 gives 20.
In your case:
$ TIMESTAMP=$(date "+%Y%m%d%H%M") $ echo $TIMESTAMP 201404011231 $ (( TIMESTAMP /= 5, TIMESTAMP *= 5 )) $ echo $TIMESTAMP 201404011230 $ TIMESTAMP=$(date "+%Y%m%d%H%M") $ echo $TIMESTAMP 201404011257 $ (( TIMESTAMP /= 5, TIMESTAMP *= 5 )) $ echo $TIMESTAMP 201404011255
TIMESTAMP=$(date "+%Y%m%d%H%M")