Here you can find the source of getUnixTime2NoneTime(String longTime)
public static String getUnixTime2NoneTime(String longTime)
//package com.java2s; import java.text.FieldPosition; import java.text.DecimalFormat; import java.util.Calendar; import java.util.Date; public class Main { public static String getUnixTime2NoneTime(String longTime) { String fileseparator = System.getProperty("file.separator"); int len = longTime.length(); long ltime = 0; if (len > 13) { longTime = longTime.substring(0, 13); }//from w w w .j av a 2 s . c o m ltime = Long.parseLong(longTime); Date date = new Date(); date.setTime(ltime); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); String yyyyMMdd = Integer.toString(calendar.get(Calendar.YEAR)) + fileseparator; yyyyMMdd += getDateFomrmat(Integer.toString(calendar.get(Calendar.MONTH) + 1)); yyyyMMdd += getDateFomrmat(Integer.toString(calendar.get(Calendar.DATE))); return yyyyMMdd; } public static String getDateFomrmat(String str) { int _input = Integer.parseInt(str); StringBuffer result = new StringBuffer(); DecimalFormat df = new DecimalFormat("00"); df.format(_input, result, new FieldPosition(1)); return result.toString(); } }