🌐
Yawk
code.yawk.at › java › 17 › java.base › java › time › temporal › ChronoUnit.java
java/17 : java.base/java/time/temporal/ChronoUnit.java
* The estimated duration of this unit is artificially defined as the largest duration * supported by {@link Duration}. */ FOREVER("Forever", Duration.ofSeconds(Long.MAX_VALUE, 999_999_999)); private final String name; private final Duration duration; private ChronoUnit(String name, Duration estimatedDuration) { this.name = name; this.duration = estimatedDuration; } //-----------------------------------------------------------------------
🌐
Oracle
docs.oracle.com › en › java › javase › 11 › docs › api › java.base › java › time › temporal › ChronoUnit.html
ChronoUnit (Java SE 11 & JDK 11 )
January 20, 2026 - java.lang.Enum<ChronoUnit> java.time.temporal.ChronoUnit · All Implemented Interfaces: Serializable, Comparable<ChronoUnit>, TemporalUnit · public enum ChronoUnit extends Enum<ChronoUnit> implements TemporalUnit · A standard set of date periods units. This set of units provide unit-based ...
🌐
Oracle
docs.oracle.com › en › java › javase › 17 › docs › api › java.base › java › time › temporal › Temporal.html
Temporal (Java SE 17 & JDK 17)
January 20, 2026 - Implementations must check and handle all units defined in ChronoUnit. If the unit is supported, then the addition must be performed.
🌐
Oracle
docs.oracle.com › en › java › javase › 17 › docs › api › java.base › java › time › temporal › TemporalUnit.html
TemporalUnit (Java SE 17 & JDK 17)
October 20, 2025 - The unit works using double dispatch. Client code calls methods on a date-time like LocalDateTime which check if the unit is a ChronoUnit. If it is, then the date-time must handle it.
🌐
o7planning
o7planning.org › 13745 › java-chronounit
Java ChronoUnit Tutorial with Examples | o7planning.org
ZonedDateTime parisNow = ZonedDateTime.now(ZoneId.of("Europe/Paris")); System.out.println("Now in Paris: " + parisNow); ZonedDateTime parisNowHour = parisNow.truncatedTo(ChronoUnit.HOURS); System.out.println("Truncated to Hour: " + parisNowHour); ... Now in Paris: 2021-07-17T05:40:15.939515+02:00[Europe/Paris] Truncated to Hour: 2021-07-17T05:00+02:00[Europe/Paris]
🌐
GitHub
github.com › frohoff › jdk8u-jdk › blob › master › src › share › classes › java › time › temporal › ChronoUnit.java
jdk8u-jdk/src/share/classes/java/time/temporal/ChronoUnit.java at master · frohoff/jdk8u-jdk
January 10, 2018 - public enum ChronoUnit implements TemporalUnit { · /** * Unit that represents the concept of a nanosecond, the smallest supported unit of time. * For the ISO calendar system, it is equal to the 1,000,000,000th part of the second unit.
Author   frohoff
🌐
Google
developers.google.com › j2objc › chronounit
ChronoUnit | J2ObjC | Google for Developers
ChronoUnit provides units like years, months, days, hours, minutes, seconds, and more for date and time calculations.
Find elsewhere
🌐
Oracle
docs.oracle.com › en › java › javase › 17 › docs › api › java.base › java › time › chrono › ChronoLocalDate.html
ChronoLocalDate (Java SE 17 & JDK 17)
April 15, 2025 - The calculation is implemented in this method for ChronoUnit. The units DAYS, WEEKS, MONTHS, YEARS, DECADES, CENTURIES, MILLENNIA and ERAS should be supported by all implementations.
🌐
Oracle
docs.oracle.com › javase › 10 › docs › api › java › time › temporal › ChronoUnit.html
ChronoUnit (Java SE 10 & JDK 10 )
java.lang.Enum<ChronoUnit> java.time.temporal.ChronoUnit · All Implemented Interfaces: Serializable, Comparable<ChronoUnit>, TemporalUnit · public enum ChronoUnit extends Enum<ChronoUnit> implements TemporalUnit · A standard set of date periods units. This set of units provide unit-based ...
🌐
Oracle
docs.oracle.com › en › java › javase › 21 › docs › api › java.base › java › time › temporal › ChronoUnit.html
ChronoUnit (Java SE 21 & JDK 21)
January 20, 2026 - Implementations should perform any queries or calculations using the units available in ChronoUnit or the fields available in ChronoField. If the unit is not supported an UnsupportedTemporalTypeException must be thrown.
🌐
JetBrains
youtrack.jetbrains.com › issue › KTIJ-20809 › Cant-import-javatimetemporalChronoUnit-due-to-absence-of-it-in-pop-up-window
Can't import java.time.temporal.ChronoUnit due to absence ...
{{ (>_<) }} This version of your browser is not supported. Try upgrading to the latest stable version. Something went seriously wrong
🌐
Stack Overflow
stackoverflow.com › questions › 72778921 › how-to-find-the-first-day-of-any-chronounit-including-quarters-in-java
datetime - How to find the first day of any ChronoUnit including quarters in Java? - Stack Overflow
ChronoUnit unit = ChronoUnit.MONTHS(WEEKS, QUARTERS, YEARS, DAYS); // Supplied by an enum instance DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd"); LocalDate start = LocalDate.parse("1990-12-15",df); LocalDate end = LocalDate.parse("1991-06-07",df); LocalDate lastCompoundDate = end; LocalDate current = start; ArrayList compoundingDates = new ArrayList<LocalDate>(); while (current.isBefore(end)) { compoundingDates.add(current); current = findFirstDateOf(current.plus(duration, unit), unit); } compoundingDates.add(end) return CompoundingDates
🌐
Yawk
code.yawk.at › java › 17 › java.base › java › time › chrono › ChronoZonedDateTime.java
java/17 : java.base/java/time/chrono/ChronoZonedDateTime.java
* <p> * The set of supported units is defined by the chronology and normally includes * all {@code ChronoUnit} units except {@code FOREVER}. * <p> * If the unit is not a {@code ChronoUnit}, then the result of this method * is obtained by invoking {@code TemporalUnit.isSupportedBy(Temporal)} * passing {@code this} as the argument.
🌐
Android Developers
developer.android.com › api reference › chronounit
ChronoUnit | API reference | Android Developers
Skip to main content · English · Deutsch · Español – América Latina · Français · Indonesia · Polski · Português – Brasil · Tiếng Việt · 中文 – 简体