private static String create_timestamp() { return Long.toString(System.currentTimeMillis() / 1000); } public Date transDate(String timeStamp) { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); Long time=new Long(timeStamp); String d = format.format(time*1000); try { return format.parse(d); } catch (Exception e) { e.printStackTrace(); return null; } }