Java SQL Date Parse strToDate(String strDate, String formator)

Here you can find the source of strToDate(String strDate, String formator)

Description

str To Date

License

Open Source License

Declaration

public static Calendar strToDate(String strDate, String formator) 

Method Source Code

//package com.java2s;

import java.util.Calendar;

public class Main {

    public static Calendar strToDate(String strDate, String formator) {
        if (strDate == null || formator == null) {
            throw new NullPointerException("The arguments are null !");
        }/*w w w.ja v  a 2 s. co m*/

        Calendar date = Calendar.getInstance();
        date.setTime(java.sql.Date.valueOf(strDate));
        return date;
    }
}

Related

  1. stringToSqlDate(String dateVal)
  2. stringToSQLDate(String pstrValue, String pstrDateFormat)
  3. stringToSqlDate(String str)
  4. StrToDate(String Formate, String date)
  5. strToDate(String str)
  6. strToDate(String stringDate)
  7. StrToDate(String val)
  8. strToDate(String value, String pattern)
  9. strToSqlDate(String format, String value)