Here you can find the source of parse(String aFormat, String date)
public static long parse(String aFormat, String date)
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; public class Main { public static long parse(String aFormat, String date) { SimpleDateFormat format = new SimpleDateFormat(aFormat); try {/*ww w . j a va2s .c o m*/ return format.parse(date).getTime(); } catch (ParseException e) { e.printStackTrace(); return 0; } } }