List of usage examples for java.time Duration getUnits
@Override
public List<TemporalUnit> getUnits()
From source file:Main.java
public static void main(String[] args) { Duration duration = Duration.between(LocalTime.MIDNIGHT, LocalTime.NOON); List<TemporalUnit> l = duration.getUnits(); for (TemporalUnit u : l) { System.out.println(u);//from ww w .jav a 2 s .c o m } }