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