I need to do the conversion java.util.Date
to java.sql.Date
. I have tried the following:
private long convertirDate(java.util.Date f1) {
java.sql.Date fechaSalida = new java.sql.Date(f1.getTimeInMillis());
}
The problem is that the date f1
comes in dd-MM-yyyy HH:mm
format when converting and inserting in the database I truncated the hour and minute always leaving 00:00