赞
踩
LocalDateTime today = LocalDateTime.now();
LocalDateTime birthDate = LocalDateTime.of(2000, 05, 31, 0, 0, 0, 0);
"相差的年数: " ChronoUnit.YEARS.between(birthDate,today);
"相差的月数: " ChronoUnit.MONTHS.between(birthDate,today);
"相差的周数: " ChronoUnit.WEEKS.between(birthDate,today);
"相差的天数: " ChronoUnit.DAYS.between(birthDate,today);
"相差的时数: " ChronoUnit.HOURS.between(birthDate, today);
"相差的分数: " ChronoUnit.MINUTES.between(birthDate, today);
"相差的秒数: " ChronoUnit.SECONDS.between(birthDate,today);
"相差的毫秒数: " ChronoUnit.MILLIS.between(birthDate,today);
"相差的微秒数: " ChronoUnit.MICROS.between(birthDate,today);
"相差的纳秒数: " ChronoUnit.NANOS.between(birthDate, today);
"相差的半天数: " ChronoUnit.HALF_DAYS.between(birthDate, today);
"相差的十年数: " ChronoUnit.DECADES.between(birthDate,today);
"相差的世纪有年数: " ChronoUnit.CENTURIES.between(birthDate,today);
"相差的千年数: " ChronoUnit.MILLENNIA.between(birthDate,today);
"相差的纪元数: " ChronoUnit.ERAS.between(birthDate,today);
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。