Here you can find the source of parse(String date)
public static long parse(String date)
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; public class Main { public static long parse(String date) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try {/* w w w .j ava2s . c o m*/ return sdf.parse(date).getTime(); } catch (ParseException e) { e.printStackTrace(); return 0; } } public static long parse(String date, String pattern) { SimpleDateFormat sdft = new SimpleDateFormat(pattern); try { return sdft.parse(date).getTime(); } catch (ParseException e) { e.printStackTrace(); return 0; } } }