String format: MM/DD/YYYY
public Timestamp convertStringToDate(String newDate) {
try {
DateFormat formatter;
Date date;
formatter = new SimpleDateFormat("MM/dd/yyyy");
date = (Date)formatter.parse(newDate);
java.sql.Timestamp timeStampDate = new Timestamp(date.getTime());
return timeStampDate;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
Timestamp format : MM/DD/YYYY 00:00:00
Tuesday, October 20, 2009
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment