Here you can find the source of getLongOfString(String date)
public static long getLongOfString(String date)
//package com.java2s; import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static long getLongOfString(String date) { String dateStr2 = date;/* ww w . j a v a 2 s. c o m*/ ParsePosition pos2 = new ParsePosition(0); SimpleDateFormat formatter2 = new SimpleDateFormat("yyyy-MM-dd"); Date strtodate2 = formatter2.parse(dateStr2, pos2); long dateLong2 = strtodate2.getTime(); return dateLong2; } }