Here you can find the source of getStrDateToDate(String dateStr)
public static Date getStrDateToDate(String dateStr)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.StringTokenizer; public class Main { public static Date getStrDateToDate(String dateStr) { String dateSplit = getDateSplit(); if (dateSplit.equals(".")) dateSplit = "\\."; StringTokenizer filter = new StringTokenizer(dateStr, dateSplit); int year = Integer.parseInt(filter.nextToken()); int mon = Integer.parseInt(filter.nextToken()) - 1; int day = Integer.parseInt(filter.nextToken()); Calendar cal = new GregorianCalendar(year, mon, day); return cal.getTime(); }//from w ww. jav a2s . c om public static String getDateSplit() { return "."; } }