Java Parse Date parseDateFrom(String dateStr)

Here you can find the source of parseDateFrom(String dateStr)

Description

parse Date From

License

Apache License

Declaration

public static Date parseDateFrom(String dateStr) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static Date parseDateFrom(String dateStr) {
        if (null == dateStr) {
            return new Date();
        }//from  w w  w.j  a  v a  2s  .  c o  m
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date value = null;
        try {
            value = sdf.parse(dateStr);
        } catch (ParseException ex) {
        }
        return value;
    }
}

Related

  1. parseDateAllowNull(String date)
  2. parseDateAndGetLong(String date)
  3. parseDateAsString(Date value)
  4. parseDateForFilter(String date)
  5. parseDateFormat(String s, String pattern, TimeZone tz)
  6. parseDateFromDateStr(String date)
  7. parseDateFromDateTimeStr(String date)
  8. parseDateFromDefault(String dateString)
  9. parseDateFromHeader(String datestr)