When I parse this date:

SimpleDateFormat sdf = new SimpleDateFormat();
                   
                    Date utilDate=sdf.parse(txtFieldArray[i].getText());//12/31/1955                    
                    java.sql.Date sqlDate=new java.sql.Date(utilDate.getTime());
                    instructorBean.setStartDate(sqlDate);

error

May 9, 2011 7:10:43 PM view.forms.profileForms.InstructorProfileForm actionPerformed
SEVERE: null
java.text.ParseException: Unparseable date: "12/28/1955"
	at java.text.DateFormat.parse(DateFormat.java:337)

Can someone show me some code on a date that can be parsed?

First of all you need to create a pattern of date.

SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
 ...

First of all you need to create a pattern of date.

SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
 ...

Thanks that works good

if (i == 7) {

                    
                    SimpleDateFormat sdf = new SimpleDateFormat();
                    sdf.applyPattern("MM/dd/yyyy");
                    Date utilDate=sdf.parse(txtFieldArray[i].getText());//12/31/1955                    
                    java.sql.Date sqlDate=new java.sql.Date(utilDate.getTime());
                    instructorBean.setStartDate(sqlDate);
                }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.