Java SQL Date Parse stringToDate(String dta)

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

Description

string To Date

License

Apache License

Declaration

public static java.sql.Date stringToDate(String dta) 

Method Source Code

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

public class Main {
    public static java.sql.Date stringToDate(String dta) {
        java.sql.Date data;/*w  ww. ja va 2 s. co m*/
        int dia = Integer.parseInt(dta.substring(0, 2));
        int mes = Integer.parseInt(dta.substring(3, 5));
        int ano = Integer.parseInt(dta.substring(6, 10));
        data = new java.sql.Date(ano - 1900, mes - 1, dia);
        return data;
    }
}

Related

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