Here you can find the source of getLongDate(String strDate)
public static Long getLongDate(String strDate)
//package com.java2s; /**//from www . j a va2 s . c om * $RCSfile: DateUtil.java * $Revision: 1.0 * $Date: Jan 30, 2011 * * Copyright (C) 2010 SlFile, Inc. All rights reserved. * * This software is the proprietary information of SlFile, Inc. * Use is subject to license terms. */ import java.util.Date; public class Main { public static Long getLongDate(String strDate) { Date date = java.sql.Date.valueOf(strDate); Long lDate = new Long(date.getTime()); return (lDate); } public static Long getLongDate(String strDate, int iType) { Long retDate = null; switch (iType) { case 0: retDate = getLongDate(strDate); break; case 1: retDate = new Long(java.sql.Timestamp.valueOf(strDate).getTime()); break; } return retDate; } }