Here you can find the source of addSecond(int second)
public static Date addSecond(int second)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date addSecond(int second) { return addTime(Calendar.SECOND, second); }// w w w . ja va 2 s. co m private static Date addTime(int timeUnit, int addTimeNum) { Calendar cal = Calendar.getInstance(); cal.add(timeUnit, addTimeNum); return cal.getTime(); } }