Here you can find the source of toTimeStamp(String myDate, String pattern, Locale language)
public static long toTimeStamp(String myDate, String pattern, Locale language)
//package com.java2s; //License from project: Open Source License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { public static long toTimeStamp(String myDate, String pattern, Locale language) { SimpleDateFormat sdf = new SimpleDateFormat(pattern, language); try {/*ww w .j a v a 2s .c o m*/ Date time = sdf.parse(myDate); return time.getTime(); } catch (ParseException e) { throw new RuntimeException(e); } } public static long toTimeStamp(String myDate, String pattern) { SimpleDateFormat sdf = new SimpleDateFormat(pattern); try { Date time = sdf.parse(myDate); return time.getTime(); } catch (ParseException e) { throw new RuntimeException(e); } } }