javafx-datepicker

HQL query to select data between two dates not returning any record

落爺英雄遲暮 提交于 2021-02-08 11:22:49
问题 ReportView I'm getting values of Dates from JavaFX DatePicker objects tDateFrom, tDateTo. I've tried, (1) List list = session.createQuery("from ReportView where date between :stDate and :edDate") .setTimestamp("stDate", Date.from(Instant.from(tDateFrom.getValue().atStartOfDay(ZoneId.systemDefault())))) .setTimestamp("edDate", Date.from(Instant.from(tDateTo.getValue().atStartOfDay(ZoneId.systemDefault())))) .list(); (2) SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

HQL query to select data between two dates not returning any record

两盒软妹~` 提交于 2021-02-08 11:21:38
问题 ReportView I'm getting values of Dates from JavaFX DatePicker objects tDateFrom, tDateTo. I've tried, (1) List list = session.createQuery("from ReportView where date between :stDate and :edDate") .setTimestamp("stDate", Date.from(Instant.from(tDateFrom.getValue().atStartOfDay(ZoneId.systemDefault())))) .setTimestamp("edDate", Date.from(Instant.from(tDateTo.getValue().atStartOfDay(ZoneId.systemDefault())))) .list(); (2) SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");