Hello i'm defining a variable in which i want to stock date-time input.
I gave this variable a format which is yyyy-mm-dd hh:MM. But in the database it keeps showing me only this format yyyy-mm-dd without hh:MM
The code
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-mm-dd hh:MM"); java.util.Date date = sdf1.parse(rs.getString("dateMaint")); java.sql.Date sqlStartDate = new Date(date.getTime()); mc.setDateMaint(sqlStartDate );
mstands for minutes whileMstands for months... You'll have to switch them in your code