Java Date Add addSeconds(Date date1, long secs)

Here you can find the source of addSeconds(Date date1, long secs)

Description

add Seconds

License

Open Source License

Parameter

Parameter Description
date1 a parameter
secs a parameter

Declaration


public static Date addSeconds(Date date1, long secs) 

Method Source Code

//package com.java2s;

import java.util.*;

public class Main {
    /**//from  w ww .  ja  v  a 2  s  .  c  om
     * @param date1
     * @param secs
     *
     * @return
     */

    public static Date addSeconds(Date date1, long secs) {
        return new Date(date1.getTime() + (secs * 1000));
    }
}

Related

  1. addDays(Date target, int days)
  2. addDays(Date when, int amount)
  3. addDays(int count, Calendar timestamp)
  4. addDaysToCurrentDate(Integer dayIncrement)
  5. addInteger(Date date, int dateType, int amount)
  6. dateAdd(Date date, int days)
  7. dateAdd(Date date, int days)
  8. dateAdd(Date date, int field, int amount)
  9. dateAdd(Date date, int type, int num)