Hi,
I have a string like "01-Feb-2004". I need to get it into a 2004-02-01 format so that I can insert into a MYSQL db.
I tried using the SimpleDateFormat, but I get an error saying - Unparseable format.
This is my code-
String todate=request.getParameter("todate");
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
df.setLenient( false );
java.util.Date tDate=null;
tDate = df.parse(todate);
Can someone please help.
Thanks.
I have a string like "01-Feb-2004". I need to get it into a 2004-02-01 format so that I can insert into a MYSQL db.
I tried using the SimpleDateFormat, but I get an error saying - Unparseable format.
This is my code-
String todate=request.getParameter("todate");
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
df.setLenient( false );
java.util.Date tDate=null;
tDate = df.parse(todate);
Can someone please help.
Thanks.