Java Parse Date parseDate(String str, String pattern)

Here you can find the source of parseDate(String str, String pattern)

Description

parse Date

License

Open Source License

Declaration

public static Date parseDate(String str, String pattern) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Date;

public class Main {

    public static Date parseDate(String str, String pattern) {
        java.text.DateFormat format = new java.text.SimpleDateFormat(pattern);
        Date date = null;// w w  w. j  a va 2s .co  m
        try {
            date = format.parse(str);
        } catch (Exception e) {
        }
        return date;
    }
}

Related

  1. parseDate(String str)
  2. parseDate(String str)
  3. parseDate(String str, boolean strict, String... parsePatterns)
  4. parseDate(String str, DateFormat df)
  5. parseDate(String str, Locale locale, String... parsePatterns)
  6. parseDate(String str, String timezone)
  7. parseDate(String str, String[] parsePatterns)
  8. parseDate(String str, String[] parsePatterns)
  9. parseDate(String strDate)