How to convert string date into Date object.
Date date = getDate("18/07/2009 15:15:45");
private static Date getDate(String fullDate) throws ParseException {
SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
df.setLenient(false); return df.parse(fullDate);
}
Date date = getDate("18/07/2009 15:15:45");
private static Date getDate(String fullDate) throws ParseException {
SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
df.setLenient(false); return df.parse(fullDate);
}

No comments:
Post a Comment