When adding the time through the new Date() method in the unit test, it reported Data truncation: Incorrect datetime value: such an error (the time type of my database table is datetime). In
this case, see if your SQL statement is successful Corresponding to
Like me, the order is wrong, because the data fails to be added because of the type, and it can be successfully added after adjustment. Another situation is that you may need to set the time format SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); l Similar to this, there are many methods anyway, just add it.