That looks like it should work. Often what's done though is like so:


time=new Date(); // time object
time.setMinutes(time.getMinutes() - 5);

From that line on the time will be 5 minutes...