public static void main(String[] args) throws Exception {
String da = "2009-09-28 20:02:30";
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
java.util.Date date = sdf1.parse(da);
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
String s = sdf.format(date);
Long longDate = Long.parseLong(s);
System.out.println(longDate);
}