Here you can find the source of getTime(String format, String date)
public static long getTime(String format, String date)
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { public static long getTime(String format, String date) { if (format == null || "".equals(format)) format = "yyyy-MM-dd"; SimpleDateFormat simpledateformat = new SimpleDateFormat(format, Locale.SIMPLIFIED_CHINESE); Date d = null;/* www.j a va 2s. c om*/ try { d = (Date) simpledateformat.parse(date); } catch (ParseException e) { e.printStackTrace(); } return d.getTime(); } }