Java Date from String convertToDate(String strDate, String format)

Here you can find the source of convertToDate(String strDate, String format)

Description

convert To Date

License

Open Source License

Declaration

public static Date convertToDate(String strDate, String format) throws ParseException 

Method Source Code


//package com.java2s;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static Date convertToDate(String strDate, String format) throws ParseException {
        SimpleDateFormat sf = new SimpleDateFormat(format);
        return sf.parse(strDate);
    }//w w  w .  jav a  2  s  .  com
}

Related

  1. convertToDate(String inDate)
  2. convertToDate(String input)
  3. convertToDate(String str)
  4. convertToDate(String str, String format)
  5. convertToDate(String strDate, String format)
  6. convertToDate(String val)
  7. convertToDate(String value)
  8. convertToDateTimeNoSec(String date)
  9. convertToDateTimeString(Date d1)