随笔分类 - java时间函数
摘要:@Test public void testTime() { var d1 = LocalDate.of(2021,1,1); var d2 = LocalDate.of(2021,7,2); Period p = Period.between(d1, d2); System.out.println
阅读全文
摘要:LocalDateTime的方法总结 https://www.cnblogs.com/linyu1/p/14079141.html DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); LocalDat
阅读全文
摘要:LocalDate必须有年,月,日三个内容 //LocalDate -> YearMonth -> String LocalDate localDate = LocalDate.now(); YearMonth yearMonth = YearMonth.of(localDate.getYear()
阅读全文