Saving Date problem
Hi,
I am trying to save some fields in a table, one field with type Date. It only accepts date with the following format (01-Jan-05). I am reading the date as a string (24/09/2005) and then convert it to date.
But i do not know to convert it to the following format (24-Sep-05) to store it in the table?? Please I need help urgently. This is my code :
<%
String issuedate = request.getParameter("issuedate");
DateFormat format = new SimpleDateFormat("dd/MM/yyyy");
myIssueDate = format.parse(issuedate);
mindecree.setIssueDate(new java.sql.Date(myIssueDate.getTime()));
%>
Note:I've tried using the following:
SimpleDateFormat format = new SimpleDateFormat("dd-MMM-yy"); Date myIssueDate = format.parse(issuedate);
But i got (Unparseable date:"19/5/2005" ) error .
Any Idea pls.???
|