我正在尝试将当前日期和时间与解析中的日期和时间进行比较。我希望查询只返回在注册期间未关闭的事件,这将是他们的“结束”日期。但由于某种原因,我的参数不起作用,代码如下:
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
最佳答案
如果是字符串,确实只使用日期。 Parse Date Col. 与 Date 相当。
query.whereGreaterThanOrEqualTo("end", new Date());
关于java - Android 将当前日期与解析查询中的日期进行比较,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35484788/