3
我正在使用GAE,我需要編寫一個Objectify查詢,要求在9月1日之後創建的元素。Objectify查詢:按日期過濾
dateCreated字段是Java.util.Date,它以這種格式存儲2012-11-29 16:03:59.494000。
此請求的工作:
public List<MyElement> listAllFromUser(String userId)
{
Objectify ofy = ObjectifyService.begin();
Query<MyElement> q=ofy.query(MyElement.class).filter("dateCreated >", "2013-09-01 00:00:00");
List<MyElement> results = q.list();
return results;
}
要麼你存儲爲日期或字符串。沒有這樣的東西存儲格式的日期。 –