将Long类型的毫秒数转换成时间格式

	public String getStandardTime(long timestamp) {
		SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss",
				Locale.getDefault());
		sdf.setTimeZone(TimeZone.getTimeZone("GMT+0"));
		Date date = new Date(timestamp+8*60*60*1000);
		sdf.format(date);
		return sdf.format(date);
	}
	

long curtime = System.currentTimeMillis();
String curString = getStandardTime(curtime);

你可能感兴趣的:(Android整理)