Java String to Date strToDate(String strDate)

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

Description

str To Date

License

Apache License

Declaration

public static Date strToDate(String strDate) 

Method Source Code

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

import java.text.ParsePosition;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public final static String FORMAT_YMD = "yyyy-MM-dd";

    public static Date strToDate(String strDate) {
        ParsePosition pos = new ParsePosition(0);
        return new SimpleDateFormat(FORMAT_YMD).parse(strDate, pos);
    }/*from   w ww  . j  a va 2s.  c om*/
}

Related

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