[CD001]
[CD002]
Java 6
String dateString = "31/05/2018"; DateFormat format = new SimpleDateFormat("dd/MM/yyyy"); // Parse will throw an Exception Date date = format.parse(dateString);