Java Timestamp Field getNextTimestamp(Timestamp previous, long nrDays)

Here you can find the source of getNextTimestamp(Timestamp previous, long nrDays)

Description

get Next Timestamp

License

Open Source License

Declaration

public static Timestamp getNextTimestamp(Timestamp previous, long nrDays) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2010 Torsten Zesch.//from   www. j a va 2s. c  o  m
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v3
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/lgpl.html
 * 
 * Contributors:
 *     Torsten Zesch - initial API and implementation
 ******************************************************************************/

import java.sql.Timestamp;

public class Main {
    public static Timestamp getNextTimestamp(Timestamp previous, long nrDays) {
        return new Timestamp(previous.getTime() + (nrDays * 24 * 60 * 60 * 1000));
    }
}

Related

  1. getMonthStartTimestamp(Date date)
  2. getNanos(Timestamp timestamp)
  3. getNanoString(Timestamp timestamp, boolean full, char nanoSep)
  4. getNbHours(Timestamp dateA, Timestamp dateB)
  5. getNextDayStart(java.sql.Timestamp stamp)
  6. getNotNullTimestampValue(String timestamp, String format)
  7. getNowTimestamp()
  8. getNowTimeStamp()
  9. getNowTimeStamp()