Here you can find the source of addTimeToDate(Date dt)
Parameter | Description |
---|---|
dt | the dt |
public static Timestamp addTimeToDate(Date dt)
//package com.java2s; //License from project: Apache License import java.sql.Timestamp; import java.util.Date; public class Main { /**//from w w w .j a va 2s . co m * Adds the time to date. * * @param dt * the dt * @return the timestamp */ public static Timestamp addTimeToDate(Date dt) { Timestamp dateVal = null; try { if (dt != null) { long onedayminusonesec = (24 * 60 * 60 * 1000) - 10; dateVal = new Timestamp(dt.getTime() + onedayminusonesec); } } catch (Exception e) { e.printStackTrace(); } return dateVal; } }