Java Parse Date Pattern YYYY parse(String dateString)

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

Description

parse

License

Apache License

Declaration

public static Date parse(String dateString) 

Method Source Code


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

import java.text.DateFormat;
import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {

    public static Date parse(String dateString) {
        return parse(dateString, "yyyy-MM-dd HH:mm:ss");
    }/*w  w w.  j av  a2 s.  c  om*/

    public static Date parse(String dateString, String pattern) {
        DateFormat df = new SimpleDateFormat(pattern);
        Date date = null;
        try {
            date = df.parse(dateString);
        } catch (Throwable t) {
            date = null;
        }
        return date;
    }
}

Related

  1. parse(String datestring)
  2. parse(String dateString)
  3. parse(String dateString)
  4. parse(String dateString)
  5. parse(String dateString)
  6. parse(String dateString)
  7. parse(String dateString)
  8. parse(String DateString)
  9. parse(String dateString)