import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class LuceneDateFieldFormat {
public static String foramtDateToString(String dateStr) throws ParseException {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date d = formatter.parse(dateStr);
SimpleDateFormat formatter1 = new SimpleDateFormat("yyyyMMddHHmmss");
return formatter1.format(d);
}
}