Java Utililty Methods Parse Date

List of utility methods to do Parse Date

Description

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

Method

DateparseDate(String dateFormat, String value)
parse Date
try {
    SimpleDateFormat formatter = new SimpleDateFormat(dateFormat);
    formatter.setTimeZone(IST);
    return formatter.parse(value);
} catch (ParseException e) {
    return null;
DateparseDate(String dateOfString, String targetFormat)
parse Date
if (dateOfString == null || dateOfString.trim().equals("")) {
    return null;
if (dateOfString != null && dateOfString.length() > 19) {
    dateOfString = dateOfString.substring(0, 19);
if (targetFormat == null) {
    return null;
...
DateparseDate(String datestr)
parse Date
if (null == datestr || "".equals(datestr)) {
    return null;
try {
    String fmtstr = null;
    if (datestr.indexOf(':') > 0) {
        fmtstr = "yyyy-MM-dd HH:mm:ss";
    } else {
...
DateparseDate(String dateStr)
parse Date
return parseDate(dateStr, DEFAULT_DATE_PATTERN);
DateparseDate(String dateStr)
Parse a string into a date
return sdf.parse(dateStr);
longparseDate(String dateStr)
parse Date
ParseException pe = null;
for (SimpleDateFormat simpleDateFormat : simpleDateFormats) {
    try {
        return simpleDateFormat.parse(dateStr).getTime();
    } catch (ParseException e) {
        pe = e;
throw pe;
DateparseDate(String dateStr)
Parses a string value into a date vale
SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_STR);
try {
    return dateFormat.parse(dateStr);
} catch (ParseException e) {
    throw new RuntimeException(e);
DateparseDate(String dateStr)
parse Date
return parseDate(dateStr, "yyyy-MM-dd");
DateparseDate(String dateStr)
parse Date
if (dateStr == null || dateStr.length() < 14)
    return null;
int hour = Integer.parseInt(dateStr.substring(0, 2));
int mins = Integer.parseInt(dateStr.substring(3, 5));
String date = dateStr.substring(6);
SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
try {
    Date tmp = format.parse(date);
...
java.util.DateparseDate(String dateStr)
parse Date
return parseDate(dateStr, "yyyy-MM-dd");