Here you can find the source of getTime(String dateString)
public static long getTime(String dateString)
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import android.os.SystemClock; public class Main { public static long getTime(String dateString) { SimpleDateFormat formatter = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss"); try {/* w ww. j a v a2s . co m*/ Date date = formatter.parse(dateString); return date.getTime(); } catch (ParseException e) { e.printStackTrace(); } return SystemClock.elapsedRealtime(); } }