/* Instant的使用 类似于Java.util.Date类 */ @Test public void test2(){ //now():对应本初子午线对应的标准时间 Instant instant = Instant.now(); System.out.println(instant); //添加时间的偏移量 OffsetDateTime offsetDateTime = instant.atOffset(ZoneOffset.ofHours(8)); System.out.println(offsetDateTime); //toEpochMilli:获取对应的毫秒数-->Date.getTime() long milli = instant.toEpochMilli(); System.out.println(milli); //ofEpochMilli:通过给定的毫秒数,获取Instant实例--->Date(long millis) Instant instant1 = Instant.ofEpochMilli(1645728380); System.out.println(instant1); }
热门文章
- 「4月1日」最高速度20.2M/S,2025年Clash/V2ray/Shadowrocket/SSR每天更新免费节点订阅链接
- 微信小程序开发笔记2——自定义导航栏组件
- 「5月2日」最高速度18.8M/S,2025年SSR/V2ray/Clash/Shadowrocket每天更新免费节点订阅链接
- 「4月18日」最高速度20.3M/S,2025年Shadowrocket/SSR/V2ray/Clash每天更新免费节点订阅链接
- 动物疫苗价格查询表图片及价格大全图(动物疫苗接种时间表)
- Instant的使用
- 宠物猫驱虫药什么牌子好(猫驱虫买什么牌子药)
- 动物接种疫苗的好处有哪些方面的问题呢(动物接种疫苗多少钱)
- 「4月30日」最高速度18.6M/S,2025年V2ray/Shadowrocket/Clash/SSR每天更新免费节点订阅链接
- 动物疫苗厂家排名榜前十名有哪些呢(动物疫苗厂家排名榜前十名有哪些呢视频)