Here you can find the source of add30Minutes(Date date)
public static Date add30Minutes(Date date)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; public class Main { public static Date add30Minutes(Date date) { Calendar currentDate = Calendar.getInstance(); currentDate.setTime(date);//from w w w . j a v a 2s .com int hour = currentDate.get(Calendar.HOUR_OF_DAY); int minute = currentDate.get(Calendar.MINUTE); int addHour = (minute + 30) / 60; minute = (minute + 30) % 60; hour = hour + addHour; currentDate.set(Calendar.HOUR_OF_DAY, hour); currentDate.set(Calendar.MINUTE, minute); return currentDate.getTime(); } }