将时间戳转换为时间

//将时间戳转换为时间 public static Date stampToDateTime(Long lt) { String res; SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //将时间戳转换为时间 Date date = new Date(lt); //将时间调整为yyyy-MM-dd HH:mm:ss时间样式 res = simpleDateFormat.format(date); Date parse = null; try { parse = simpleDateFormat.parse(res); } catch (ParseException e) { e.printStackTrace(); } return parse; }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章