Java Timestamp addDaysToTimestamp(Timestamp start, int days)

Here you can find the source of addDaysToTimestamp(Timestamp start, int days)

Description

add Days To Timestamp

License

Apache License

Declaration

public static Timestamp addDaysToTimestamp(Timestamp start, int days) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.sql.Timestamp;

public class Main {
    public static Timestamp addDaysToTimestamp(Timestamp start, int days) {
        return new Timestamp(start.getTime() + (24L * 60L * 60L * 1000L * days));
    }/*w  ww  . ja  v  a 2s. c  o  m*/

    public static Timestamp addDaysToTimestamp(Timestamp start, Double days) {
        return new Timestamp(start.getTime() + ((int) (24L * 60L * 60L * 1000L * days)));
    }
}

Related

  1. add(Timestamp target, int addNum, int addKind)
  2. add(Timestamp ts, int field, int amount)
  3. addDate(Timestamp date, String type, int into)
  4. addDays(Timestamp date, int days)
  5. addDays(Timestamp day, int offset)
  6. addDaysToTimestamp(Timestamp timestamp, int numDays)
  7. addHours(Timestamp date, int numOfHours)
  8. addHoursToTimestamp(Timestamp start, int hours)
  9. addMilli(Timestamp nowDate, int period)