如何将当前系统时间与存储在android数据库中的时间进行比较?我使用这个代码:
public static long s ;
.
.
.
.
Time now = new Time();
now.setToNow();
String query = "SELECT Cart_ID,Cart_Date from Tbl_Cart where Cart_ID="+lastId+" ";
// String queryt = "SELECT Cart_Date from Tbl_Cart where Cart_ID="+lastId+" ";
Cursor c = db.rawQuery(query, null);
if (c != null && c.moveToFirst() ) {
s = c.getLong(0);
}
if(s==now.setToNow())
{
...
}