Java Date Parse getDateFromStr(String date)

Here you can find the source of getDateFromStr(String date)

Description

get Date From Str

License

Open Source License

Declaration

public static Date getDateFromStr(String date) 

Method Source Code


//package com.java2s;

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public static Date getDateFromStr(String date) {
        Date result = null;/*from  w  w  w. j a v a2  s  .c om*/
        try {
            SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
            sdf.setLenient(false);
            result = sdf.parse(date);
        } catch (Exception e) {
            System.out.println("Error: " + e.toString());
        }

        return result;
    }
}

Related

  1. getDateFromOriDateStr(String strDate)
  2. getDateFromRange(String date)
  3. getDateFromRequestStringDate(String dateString)
  4. getDateFromRFC822String(Object rfc822)
  5. getDateFromStr(DateFormat format, String s)
  6. getDateFromStr(String inputDate, String inputFormatStr)
  7. getDateFromString(final String dateStr, final String pattern)
  8. getDateFromString(final String dateString, final String dateFormatString)
  9. getDateFromString(final String inputStringDate, final String format)