Here you can find the source of dayFillter(String text, String type)
public static Date dayFillter(String text, String type)
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static Date dayFillter(String text, String type) { SimpleDateFormat format = new SimpleDateFormat(type); try {//from w w w . j av a2 s .co m return format.parse(text); } catch (ParseException e) { e.printStackTrace(); } return new Date(); } public static Date parse(String text, String type) throws ParseException { SimpleDateFormat format = new SimpleDateFormat(type); return format.parse(text); } }