Here you can find the source of addSecond(Date date, int numberOfSecond)
Parameter | Description |
---|---|
date | a parameter |
numberOfSecond | a parameter |
public static Date addSecond(Date date, int numberOfSecond)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; public class Main { /**//from w w w . j a v a 2s.c o m * * @param date * @param numberOfSecond * @return * @deprecated */ public static Date addSecond(Date date, int numberOfSecond) { if (numberOfSecond == 0) { return date; } Calendar cal = Calendar.getInstance(); cal.setTime(date); cal.add(Calendar.SECOND, numberOfSecond); date = cal.getTime(); return date; } }