日期時間加一天

最近實現日期查詢功能,前臺輸入了起止日期,後臺收到日期,想要止日期加一天,因爲日期都是算0時0分0秒的,不然查詢不出當天的結果。

CriteriaQuery cq = new CriteriaQuery(MemberFeedbackEntity.class, dataGrid);

Calendar ca = Calendar.getInstance();

ca.setTime(new SimpleDateFormat("yyyy-MM-dd").parse(query_feedbackTime_end));

ca.add(Calendar.DATE, 1);//日期加一天

cq.le("feedbackTime", ca.getTime());

cq.add();
this.memberFeedbackService.getDataGridReturn(cq, true);
TagUtil.datagrid(response, dataGrid);

這樣即完成了日期的查詢

發佈了56 篇原創文章 · 獲贊 5 · 訪問量 16萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章