DateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); format.format(new Date(format.parse(str).getTime())) mysql convert( s as datetime)