600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > 将10位或13位时间戳转换为日期+时间--yyyy-MM-dd HH:mm:ss

将10位或13位时间戳转换为日期+时间--yyyy-MM-dd HH:mm:ss

时间:2021-12-26 16:04:50

相关推荐

将10位或13位时间戳转换为日期+时间--yyyy-MM-dd HH:mm:ss

将10位或13位时间戳转换为日期+时间–yyyy-MM-dd HH:mm:ss

public static void main(String[] args) {//10位秒时间戳 转换String date_one = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(toInt("1587467078") * 1000L));//-04-21 19:04:38System.out.println("10位秒时间戳1587467078 转换后为: "+date_one);//13位毫秒级时间戳 转换String date_two = new SimpleDateFormat("yyyy-MM-dd HH:MM:ss").format(new Date(Long.parseLong("1587469418125")));//-04-21 19:04:38System.out.println("13位毫秒时间戳 1587469418125 转换后为: "+date_two);}

更多精彩,请点击此链接✈✈✈✈✈✈

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。