Java Parse Date Pattern YYYY parse(String strDate)

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

Description

parse

License

Open Source License

Declaration

public static Date parse(String strDate) 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 String defaultDatePattern = "yyyy-MM-dd";

    public static Date parse(String strDate) throws ParseException {
        return parse(strDate, getDatePattern());
    }//from  w  w  w. j av a  2s  . co m

    public static Date parse(String strDate, String pattern) throws ParseException {
        SimpleDateFormat df = new SimpleDateFormat(pattern);
        return df.parse(strDate);
    }

    public static String getDatePattern() {
        return defaultDatePattern;
    }
}

Related

  1. parse(String str)
  2. parse(String str)
  3. parse(String str)
  4. parse(String str)
  5. parse(String str)
  6. parse(String strDate)
  7. parse(String string)
  8. parse(String string)
  9. parse(String stringData)