Here you can find the source of strtotime(String strtime)
public static long strtotime(String strtime)
//package com.java2s; //License from project: LGPL import java.text.ParseException; import java.text.SimpleDateFormat; public class Main { public static String TIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; public static long strtotime(String strtime) { try {/* ww w .j av a2s . co m*/ SimpleDateFormat format = new SimpleDateFormat(TIME_FORMAT); return format.parse(strtime).getTime(); } catch (ParseException e) { e.printStackTrace(); } return 0; } }