Java String to Date strToDate(String strDate)

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

Description

str To Date

License

Open Source License

Declaration

public static Date strToDate(String strDate) 

Method Source Code


//package com.java2s;
import java.text.*;
import java.util.*;

public class Main {
    public static Date strToDate(String strDate) {
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        ParsePosition pos = new ParsePosition(0);
        Date strtodate = formatter.parse(strDate, pos);
        return strtodate;
    }/*from   w w  w  .  j  av a2  s.com*/
}

Related

  1. strToDate(String s, Date defaultValue)
  2. strToDate(String str)
  3. strToDate(String str, String format, java.util.Date defaultValue)
  4. strToDate(String strD)
  5. strToDate(String strDate)
  6. strToDate(String strDate)
  7. strToDate(String strDate, String format)
  8. strToDate(String time, String format)
  9. strToDate3(String i_StrDate)