比如將java.sql.Timestamp型別某個物件日期加一天或者減一天,網上找了很久都沒有找到合適的。
uj5u.com熱心網友回復:
Timestamp currentTime = new Timestamp(System.currentTimeMillis());
// 這里增加1天就是24 * 3600 * 1000,2天就是2*24 * 3600 * 1000,如此類推
Timestamp secondDay = new Timestamp(currentTime .getTime()+(24 * 3600 * 1000));
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/244014.html
標籤:Java SE
