[Solved] convert string time to date type in java
With java.sql.Time you retrieve the right value from your time field in mysql. import java.io.IOException; import java.sql.Time; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class teste { /** * @param args * @throws IOException */ public static void main(final String[] args) throws IOException { SimpleDateFormat sdf = new SimpleDateFormat(“HH:mm:ss”); try { Date data = sdf.parse(“21:00:00”); … Read more