Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

camel-bindy 2.13.1 DateFormat Unparseable date

$
0
0
camel-bindy is throwing an *java.text.ParseException * on failing to parse
date with format *"dd-MMM-yyyy hh"*

*The date field in the CsvRecord is:*
@DataField(pos = 1, required = true, pattern = "dd-MMM-yyyy hh")

*Row from CSV file:*
"10-Nov-2013 00","ARTHUR","2","CON ED NY CITY",332.8,90,90,,35,,70,,0,23512

*Sample test below works fine:*
private static void testDate(){
String dateString="10-Nov-2013 00";
SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MMM-yyyy hh");
Date date =null;
try {
date = dateFormat.parse(dateString);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();

System.out.println( " Formated date :" + date);

Viewing all articles
Browse latest Browse all 5648

Trending Articles