首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

Date,LocalDate,时间戳获取时间的方式与转换「建议收藏」

开发过程中总会涉及到时间转换问题,下面描述了几种时间的获取方式以及转换: 1.Date日期格式化 2.LocalDate获取年月日 3.时间戳的获取 4.Date转换时间戳 5.时间戳Date...获取年月日 public static void main(String[] args){ LocalDate lldate = LocalDate.now(); System.out.println...[] args){ Long timestamp = System.currentTimeMillis(); System.out.println("当前时间的时间戳13位: "+timestamp...); System.out.println("当前时间时间戳10位: "+Long.valueOf(timestamp/1000)); } 输出结果为: 当前时间的时间戳13位: 1563443626049...)))); System.out.println("date时间戳: "+ds); } 输出结果为: date时间戳: 2019-07-18 14:06:05 5.时间戳Date

3.8K10
领券