Java Second Add addSecond(int second)

Here you can find the source of addSecond(int second)

Description

add Second

License

Apache License

Declaration

public static Date addSecond(int second) 

Method Source Code

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

Related

  1. addSecond(Date date, int n)
  2. addSecond(Date date, int number)
  3. addSecond(Date date, int numberOfSecond)
  4. addSecond(Date date, int second)
  5. addSecond(Date source, int s)
  6. addSeconds(Date date, int seconds)
  7. addSeconds(Date date, int seconds)
  8. addSeconds(final Date date, final int seconds)
  9. addSeconds(int addSeconds)