SimpleDateFormat format = new SimpleDateFormat("yyyy-M-dd HH:mm:ss"); //造型随你喜欢 Long time=null; //timestamp为需要转换的时间戳 time=new Long(String.valueOf(timestamp)); //转换成字符串 String timestr=format.format(time); //转换成Date类型 format.parse(timestr);
SimpleDateFormat format = new SimpleDateFormat("yyyy-M-dd HH:mm:ss"); //造型随你喜欢 Long time=null; //timestamp为需要转换的时间戳 time=new Long(String.valueOf(timestamp)); //转换成字符串 String timestr=format.format(time); //转换成Date类型 format.parse(timestr);