Here you can find the source of addSecond(Date date, int n)
public static Date addSecond(Date date, int n)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date addSecond(Date date, int n) { Calendar cal = Calendar.getInstance(); cal.setTime(date);//from www . j a v a 2 s .co m cal.add(Calendar.SECOND, n); return cal.getTime(); } }