Convert java.util.Date to java.sql.Date

0

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

    
asked by nachfren 15.07.2018 в 19:52
source

0 answers