Input: 2017-03-15
String date="2017-03-15"; LocalDate localedate = LocalDate.parse( date ); cal = Calendar.getInstance(); cal.set(Calendar.YEAR, localedate.getYear()); cal.set(Calendar.MONTH, localedate.getMonthValue()); cal.set(Calendar.DAY_OF_MONTH, localedate.getDayOfMonth()); date1 = cal.getTime(); At the exit I get - Sat Apr 15 16:12:47 GMT + 02: 00 2017. Why is there a month error? 2nd moment: I write down the date in postgresql, and in my database not only the date but also the time is recorded. How to avoid it. For reference: the type of the column in postgresql, I use date. The documentation says - the date (without the time of day) . In Pojo, I use java.util.Date respectively on a table.