Here you can find the source of getTimestamp(String timeStampStr, String logRundateIdStr)
public static String getTimestamp(String timeStampStr, String logRundateIdStr)
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String getTimestamp(String timeStampStr, String logRundateIdStr) { SimpleDateFormat timeDf = new SimpleDateFormat("yyyyMMdd"); String resultValue = "0"; try {/* w w w . j a v a 2 s. com*/ new Date(Long.valueOf(timeStampStr) * 1000); resultValue = timeStampStr; } catch (NumberFormatException e) { // TODO Auto-generated catch block try { Date date = timeDf.parse(logRundateIdStr); resultValue = date.getTime() / 1000 + ""; } catch (ParseException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } return resultValue; } }