This is a bit complicated. Date can do general manipulations, i.e. You can:
date --date '-10 min'
Setting the hour-min-seconds (using UTC, because otherwise it seems to be PM):
date --date '11:45:30 UTC -10 min'
To split the date string, the only way I can think of is to expand the substring:
a=114530
date --date "${a:0:2}:${a:2:2}:${a:4:2} UTC -10 min"
And if you want to just return hhmmss:
date +%H%M%S --date "${a:0:2}:${a:2:2}:${a:4:2} UTC -10 min"
source
share