Java String to Date stringToDate(String strDate)

Here you can find the source of stringToDate(String strDate)

Description

Convert String to Date with MM/dd/yyyy format.

License

Open Source License

Parameter

Parameter Description
strDate a parameter

Exception

Parameter Description
ParseException an exception

Declaration

public static Date stringToDate(String strDate) throws ParseException 

Method Source Code

//package com.java2s;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    /**//from   ww  w  . ja v a  2s.c  om
     * Convert String to Date with MM/dd/yyyy format.
     * @param strDate
     * @return
     * @throws ParseException
     */
    public static Date stringToDate(String strDate) throws ParseException {
        Date date = new SimpleDateFormat("MM/dd/yyyy").parse(strDate);
        return date;
    }
}

Related

  1. stringToDate(String str)
  2. StringToDate(String str)
  3. StringToDate(String str, String format)
  4. stringToDate(String str, String format)
  5. stringToDate(String str, String formatStr)
  6. stringToDate(String strDate)
  7. stringToDate(String strDate)
  8. stringToDate(String strDate)
  9. stringToDate(String strDate, String formartStr)