java 获取秒数
public static String parseTimeMillis(String time) throws Exception{ if(time==null || "".equals(time)){ time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = sdf.parse(time); String s = String.valueOf(date.getTime()); return s.substring(0, s.length()-3); }