Here you can find the source of parseDate(String dateStr)
Parameter | Description |
---|---|
dateStr | a parameter |
public static java.util.Date parseDate(String dateStr)
//package com.java2s; //License from project: Open Source License public class Main { public static java.util.Date parseDate(String dateStr, String format) { java.util.Date date = null; try {//from w w w .ja v a 2s .co m java.text.DateFormat df = new java.text.SimpleDateFormat(format); date = (java.util.Date) df.parse(dateStr); } catch (Exception e) { e.printStackTrace(); } return date; } public static java.util.Date parseDate(String dateStr) { return parseDate(dateStr, "yyyy-MM-dd"); } }