摘要:
JDK8之前的时间API的一些问题 可变性:像日期和时间这样的类应该是不可变的。 偏移性:Date中的年份是从1900开始的,而月份都从0开始。 格式化:格式化只对Date有用,Calendar则不行。 此外,它们也不是线程安全的;不能处理闰秒。 @Test public void testDate 阅读全文
posted @ 2021-06-09 16:11
koito
阅读(96)
评论(0)
推荐(0)
摘要:
Calendar日历类(抽象类)的使用 Calendar是一个抽象基类,主要用于完成日期字段之间相互操作的功能。 获取Calendar实例的方法 创建其子类(GregorianCalendar)的对象 调用其静态方法getInstance() 一个Calendar的实例是系统时间的抽象表示,通过ge 阅读全文
posted @ 2021-06-09 15:24
koito
阅读(103)
评论(0)
推荐(0)

浙公网安备 33010602011771号