I have a Java date object:
Date currentDate = new Date();
This will give the current date and time. Example:
Thu Jan 12 10:
Or using the famous Joda Time library:
DateTime dateTime = new DateTime(); dateTime = dateTime.minusHours(1); Date modifiedDate = dateTime.toDate();