1

I am trying to parse the date format [[$-C09]dd\-mmm\-yy;@] using SimpleDateFormat with default Locale. But it throws:

java.lang.IllegalArgumentException: Illegal pattern character 'C'

How to parse the date using this date format? C09 in the date format denotes the Australian country code.

My Code snippet:

String pattern = "[$-C09]dd-mmm-yy;@";
SimpleDateFormat dateFormat = new SimpleDateFormat(pattern,Locale.getDefault());

Source:

Please refer the SO answers below for Country wide codes.

Community
  • 1
  • 1
user492888
  • 207
  • 3
  • 17
  • Use single quotes to quote random strings. Described [in the documentation](http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html). – Boris the Spider Jul 10 '14 at 14:58

0 Answers0