I want to add 5 seconds to current time
Date date = new Date(); date.setSeconds(date.getSeconds()+ 5); System.out.println(\"old Value is: \"+date);
you can use date.setTime(date.getTime() + 5000)
date.setTime(date.getTime() + 5000)