Java Second Add addSeconds(int addSeconds)

Here you can find the source of addSeconds(int addSeconds)

Description

add Seconds

License

Apache License

Declaration

public static Date addSeconds(int addSeconds) 

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 addSeconds(Date src, int addSeconds) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(src);//  w  ww.j a  v a 2s .co m
        calendar.add(Calendar.SECOND, addSeconds);
        return calendar.getTime();
    }

    public static Date addSeconds(int addSeconds) {
        return addSeconds(new Date(), addSeconds);
    }
}

Related

  1. addSecond(Date source, int s)
  2. addSecond(int second)
  3. addSeconds(Date date, int seconds)
  4. addSeconds(Date date, int seconds)
  5. addSeconds(final Date date, final int seconds)