how to convert String date to Date object.

Hi guys,

I'm trying to convert a string date to a date object.

The string date (comes from javaScript) looks like this:

Sat Nov 4 2006

I have this method, and wonder what should come in the XXXXX section:

publicstatic Date getDate(String str)

{

try

{

Date date =new SimpleDateFormat("XXXXX ").parse(str);

return date;

}catch (ParseException e)

{

e.printStackTrace();

returnnull;

}

}

I initially thought its: DDDMMMYYYY but I was wrong.

thanks

[1007 byte] By [xianwinwina] at [2007-10-3 9:22:13]
# 1
"EEE MMM d yyyy"
zadoka at 2007-7-15 4:35:50 > top of Java-index,Java Essentials,Java Programming...
# 2
thanks!
xianwinwina at 2007-7-15 4:35:50 > top of Java-index,Java Essentials,Java Programming...