Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; public class Main { /** * ???long????? * * @param s * @return */ public static long getDateLong(String s) { long l = 0; try { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); l = sdf.parse(s).getTime(); } catch (Exception e) { e.printStackTrace(); } return l; } }