正确的时间戳转换

if (!TextUtils.isEmpty(loginInfo.getBirthday())) {
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.CHINA);
    try {
        int i = Integer.parseInt(loginInfo.getBirthday());
        String times = dateFormat.format(new Date(i * 1000L));
        tv_birthday.setText(times);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
 
点击打开链接

猜你喜欢

转载自blog.csdn.net/gincoo/article/details/76942401