Parse date string input with default Canada Format in Java
Description
The following code shows how to parse date string input with default Canada Format.
Example
/*from w ww .j a v a2 s .c o m*/
import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;
public class Main {
public static void main(String[] argv) throws Exception {
Date date = DateFormat.getTimeInstance(DateFormat.DEFAULT, Locale.CANADA).parse("21.33.03");
System.out.println(date);
}
}
The code above generates the following result.