Here you can find the source of parseDate(String str)
Parameter | Description |
---|---|
str | String. |
static public Date parseDate(String str)
//package com.java2s; /* Please see the license information at the end of this file. */ import java.util.*; import java.text.*; public class Main { /** Date formatter for dates in format e.g. 02/06/02. */ static private final SimpleDateFormat dateFormatter3 = new SimpleDateFormat("MM/dd/yy"); /** Parses a date. */* ww w.j a v a 2 s. c o m*/ * @param str String. * * @return The date, or null if syntax error. */ static public Date parseDate(String str) { ParsePosition pos = new ParsePosition(0); Date result = dateFormatter3.parse(str, pos); if (result != null && pos.getIndex() < str.length()) result = null; return result; } }