LocalDateTime remove the millisecondsTruncate
I am working on java application where i am using Java 8.
I have integrated the database(multiple database Oracle, Mysql, Postgres) and where in DB i string the created date.
the date format in DB is - 2015-07-29 16:23:28.143
I fetch this from DB and set in Localdatetime object
myObj.setCreated(rs.getTimestamp("created").toLocalDateTime());
So here the issue is i don't want to show/send the millisecond in the response. i want to show/send date like 2015-07-29 16:23:28
I tried the formatter but it fails as it gives a string and i don't want to change the LocalDateTime object to String as this going to cause major change in all Java application.So want to find the solution
Can anybody know any solution to this?