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;
        }
 
    }

 

posted on 2018-01-19 15:18  梓木的稻稻  阅读(111)  评论(0编辑  收藏  举报