I have a Java date object:
Date currentDate = new Date();
This will give the current date and time. Example:
Thu Jan 12 10:
Use Calendar.
Calendar cal = Calendar.getInstance(); cal.setTime(new Date()); cal.set(Calendar.HOUR, cal.get(Calendar.HOUR) - 1);