Here you can find the source of addTime(Date source, int hours, int minutes, int second)
public static Date addTime(Date source, int hours, int minutes, int second)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date addTime(Date source, int hours, int minutes, int second) { if (source == null) { return null; }/*from w w w .ja va 2 s. c om*/ Calendar cal = Calendar.getInstance(); cal.setTime(source); cal.add(Calendar.HOUR_OF_DAY, hours); cal.add(Calendar.MINUTE, minutes); cal.add(Calendar.SECOND, second); return cal.getTime(); } }