您可以使用以下方法获取3小时的时间戳记
Calendar cal = Calendar.getInstance();cal.add(Calendar.HOUR, -3);Date threeHourBack = cal.getTime();
然后,您可以传递
threeHourBack.getTime()给查询。
或者您可以在SQLite中执行此操作
SELECt * FROM Table1 where datetime(timestamp) >=datetime('now', '-3 Hour')


