I need to convert a date (without time component), chosen using toedter JCalendar, to an SQL Timestamp (i.e. with 0:00:00 time part) to use it in SQL queries.
I there nothing more simple or elegant than this? What is recommended?
Date dt = jCalendar1.getDate();
Timestamp ts = Timestamp.valueOf(dt.toInstant().atZone(ZoneId.systemDefault()).toLocalDate().atStartOfDay());