String dateString = "2022-01-01"; LocalDate date = LocalDate.parse(dateString, DateTimeFormatter.ISO_DATE); String formattedDate = date.format(DateTimeFormatter.ofPattern("yyyy/MM/dd")); LocalDate currentDate = LocalDate.now(); LocalDate nextYear = currentDate.plusYears(1); LocalDate previousDay = currentDate.minusDays(1); ZoneId currentZone = ZoneId.systemDefault(); ZonedDateTime dateWithNewZone = ZonedDateTime.of(LocalDateTime.now(), ZoneId.of("America/New_York"));


上一篇:
下一篇:
切换中文