Timestamp after Minutes - Java java.sql

Java examples for java.sql:Timestamp

Description

Timestamp after Minutes

Demo Code

/**//from   w  w  w. j  a va  2 s.  c  o m
 * <p>Project: fsp</p>
 * <p>Title: Constants.java</p>
 * <p>Description: </p>
 * <p>Copyright (c) 2014 Sunlights.cc</p>
 * <p>All Rights Reserved.</p>
 *
 * @author <a href="mailto:zhencai.yuan@sunlights.cc">yuanzhencai</a>
 */
//package com.java2s;
import java.sql.Timestamp;

public class Main {
    private static final long ONE_MINUTE = 60000;

    public static Timestamp afterMinutes(Timestamp date, long min) {
        long fTime = date.getTime() + min * ONE_MINUTE;
        return new Timestamp(fTime);
    }
}

Related Tutorials