I have this code
I am trying to get the currentTime at which my program runs and want to get 7 hours prior to that
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
Calendar cal = Calendar.getInstance();
String currentRunningTime = dateFormat.format(cal.getTime()); //current time at which my program runs
String sevenHoursPreviousTime = "";
so if currentRunningTime = 2013-11-19 13:21:55.027
i want to subtract 7 hours from currentRunningTime.
Any idea how i can do that?
Any help would be appreciated.