【发布时间】:2011-11-07 10:23:04
【问题描述】:
我未能将秒数添加到 Java 时间戳。
我有这个,但是它给了我相同的日期:
int sec = 600;
java.sql.Timestamp ts_from_ws = new java.sql.Timestamp(retry_date);
Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(ts_from_ws.getTime());
cal.add(Calendar.SECOND,sec);
java.sql.Timestamp ts_new_date_ws = new java.sql.Timestamp(cal.getTime().getTime());
【问题讨论】: