public String paserTime(int time){ System.setProperty("user.timezone", "Asia/Shanghai"); TimeZone tz = TimeZone.getTimeZone("Asia/Shanghai"); TimeZone.setDefault(tz); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String times = format.format(new Date(time * 1000L)); System.out.print("日期格式---->" + times); return times; }//源代码片段来自云代码http://yuncode.net