Java String to Date StringToDate(String fecha)

Here you can find the source of StringToDate(String fecha)

Description

String To Date

License

Open Source License

Declaration

public static Date StringToDate(String fecha) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    public static Date StringToDate(String fecha) {

        SimpleDateFormat formatoDelTexto = new SimpleDateFormat("yyyy/MM/dd");
        Date aux = null;/* w  w w . j  av  a2s .c  om*/
        try {
            aux = formatoDelTexto.parse(fecha);
        } catch (Exception ex) {

        }

        return aux;

    }
}

Related

  1. stringTodate(String dateString, String format)
  2. stringToDate(String dateString, String formatStr)
  3. stringToDate(String dateString, String pattern)
  4. stringToDate(String dateText, String format, boolean lenient)
  5. StringToDate(String Expression)
  6. stringToDate(String fecha, String formato)
  7. StringToDate(String format, String dateStr)
  8. stringToDate(String input)
  9. stringToDate(String pstrValue, String pstrDateFormat)