Here you can find the source of parseDate(String strDate)
Parameter | Description |
---|
public static Date parseDate(String strDate)
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date parseDate(String strDate, String patter) { Date date = null;/*from w ww. j a v a 2 s .co m*/ SimpleDateFormat sdf = new SimpleDateFormat(patter); try { date = sdf.parse(strDate); } catch (ParseException e) { e.printStackTrace(); return null; } return date; } public static Date parseDate(String strDate) { Date date = null; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { date = sdf.parse(strDate); } catch (ParseException e) { e.printStackTrace(); return null; } return date; } }