[求助]java中date.setTime(mtime * 1000)有错吗?
public String getAdd7Or14(int daynum) { Date date = new Date();
String addday = "";
long mtime;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
if (daynum == 7) {
mtime = (date.getTime() / 1000) + 60 * 60 * 24 * 7;
} else if (daynum == 14) {
mtime = (date.getTime() / 1000) + 60 * 60 * 24 * 14;
}
//==================================
date.setTime(mtime * 1000);
// ==========上面的mtime会报错呢?===
addday = sdf.format(date);
return addday;
}
这怎么会有错呢?我真是想不通。
[此贴子已经被作者于2007-8-7 11:41:44编辑过]