ZoneId zoneId = ZoneId.systemDefault(); LocalDateTime localDateTime = LocalDateTime.ofInstant(mcRegister.getCreateTime().toInstant(), zoneId); LocalDateTime localDate1 = LocalDateTime.now(); long betweenDays = ChronoUnit.DAYS.between(localDateTime.toLocalDate(), localDate1.toLocalDate()); int daysTotal =Integer.parseInt(pregnantWeek)*7+Integer.parseInt(pregnantDay)+(int)betweenDays; a = daysTotal / 7;//孕周 b = daysTotal % 7;//孕天
localDateTime 转date
最新推荐文章于 2024-07-20 09:08:25 发布