Jabal- (.. , JDK), :
long hour = 3600 * 1000;
Date anotherDate = new Date(date.getTime() + hour);
, , :
TimeZone timeZone = TimeZone.getTimeZone("UTC");
sdf.setTimeZone(timeZone);
BTW. Hard coding date format is not the best of ideas. If you have no reason for this, you should use the one that is valid for the user Locale ( DateFormat df = DateFormat.getTimeInstance(DateFormat.DEFAULT, locale);). Otherwise, you create an i18n defect (who cares, I know).
source
share