当前位置: 代码迷 >> 综合 >> JAVA 时间戳转换为时间,android 时间戳转化为正常格式的时间显示
  详细解决方案

JAVA 时间戳转换为时间,android 时间戳转化为正常格式的时间显示

热度:17   发布时间:2024-02-20 22:16:40.0
    /** 将时间戳转换为时间* @param time是传进来的时间戳*/public static String stampToDate(long time) {String normalTime;//格式化SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");Date date = new Date(time);normalTime = simpleDateFormat.format(date);return normalTime;}