我試圖比較當前的日期和時間與解析日期和時間。我希望查詢僅返回未結束的事件,因爲它們的註冊週期將是它們的「結束」日期。但由於某種原因,我的參數不起作用的代碼是以下內容:Android比較當前日期到解析查詢日期
String currentDateTimeString = DateFormat.getDateTimeInstance().format(new Date());// gets current date and time
query.whereGreaterThanOrEqualTo("end", currentDateTimeString);// should compare the dates and if the end date is past the current moment and time of this query not display that event
請說明您實際遇到的問題。什麼信息或不正確的行爲正在發生?實際比較失敗的地方在哪裏?顯示該代碼並調試或記錄指示失敗的信息。你上面顯示的只是給你的'ParseQuery'對象添加一個約束。你究竟在哪裏評估查詢的結果? – rothloup