Java Utililty Methods String to Date

List of utility methods to do String to Date

Description

The list of methods to do String to Date are organized into topic(s).

Method

DatetransformStringToDate(String dateString)
transform String To Date
Date date;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
    date = simpleDateFormat.parse(dateString);
} catch (ParseException e) {
    e.printStackTrace();
    date = new Date();
return date;
DatetranslateToDate(String aDate, String aFormat)
Takes a string representing a date and converts it to a real date according to a given format.
SimpleDateFormat dateFormatter = new SimpleDateFormat();
dateFormatter.applyPattern(aFormat);
Date returnDate = dateFormatter.parse(aDate);
return returnDate;