Java SQL Date Parse stringToDate(String str)

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

Description

string To Date

License

Open Source License

Declaration

public static Date stringToDate(String str) 

Method Source Code

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

import java.util.Date;

public class Main {

    public static Date stringToDate(String str) {
        // DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        Date date = null;//from   w  w  w .j  a  v a2  s  .  c o  m
        try {
            // 2012-02-24
            date = java.sql.Date.valueOf(str);
        } catch (Exception e) {
            e.printStackTrace();
        }

        return date;
    }
}

Related

  1. stringToDate(final String dateString)
  2. stringToDate(String date)
  3. stringToDate(String date, Class dateType)
  4. stringToDate(String dateStr)
  5. stringToDate(String dta)
  6. stringToDate(String str)
  7. StringToDateHMS(String str)
  8. stringToSqlDate(String data)
  9. stringToSqlDate(String date)