Java SQL Date Create convertDateFromString(String inputDateString)

Here you can find the source of convertDateFromString(String inputDateString)

Description

convert Date From String

License

Open Source License

Declaration

public static Date convertDateFromString(String inputDateString) throws ParseException 

Method Source Code


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

import java.sql.Date;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;

public class Main {
    public static String DEFAULT_DATE_FORMAT = "dd-mm-yyyy";

    public static Date convertDateFromString(String inputDateString) throws ParseException {
        DateFormat sf = new SimpleDateFormat(DEFAULT_DATE_FORMAT);
        return new Date(sf.parse(inputDateString).getTime());
    }/*from w w  w . ja v a  2 s .  co m*/
}

Related

  1. castToSqlDate(Object value)
  2. convert(Date date)
  3. convertDate(java.sql.Date date)
  4. convertDateFromSQLDate(java.sql.Date sqlDate)
  5. convertDateFromSqlToUtil(java.sql.Date sqlDate)
  6. convertDateFromUtilToSql(java.util.Date utilDate)
  7. convertDateIfNecessary(Date date)
  8. convertDateToString(java.sql.Date argDate)
  9. convertFormat(java.sql.Date dt, String formatter)