Java Second Add addSecond(Date date, int n)

Here you can find the source of addSecond(Date date, int n)

Description

add Second

License

Open Source License

Declaration

public static Date addSecond(Date date, int n) 

Method Source Code

//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();
    }
}

Related

  1. addOrMinusSecond(long ti, int i)
  2. addSecond(Date date, int number)
  3. addSecond(Date date, int numberOfSecond)
  4. addSecond(Date date, int second)
  5. addSecond(Date source, int s)