[求助]我想要2次的时间相减。为什么总报格式不正确!急
包已经引入好了的有问题的代码是这样
Date date=new Date();
Long logonTime=new Timestamp(date.getTime());
Long lastTime=rs.getLong("logonTime");//是查询出的结果。
if ((logonTime-lastTime)>15*24*3600*1000)//相减
错误是这样的
Error(29,29): incompatible types; found: java.sql.Timestamp, required: java.lang.Long
Error(45,26): incompatible types; found: long, required: java.lang.Long
Error(48,16): method -(java.lang.Long, java.lang.Long) not found in class mypackage.logon
问题多多!麻烦指正!谢谢!