If you attempt to format an Instant with:
String duration = HumanizeTime.fromNow(Instant.now());
you get an error:
java.time.temporal.UnsupportedTemporalTypeException: Unsupported unit: Years
at java.base/java.time.Instant.until(Instant.java:1156) ~[na:na]
at java.base/java.time.temporal.ChronoUnit.between(ChronoUnit.java:272) ~[na:na]
at to.lova.humanize.time.HumanizeTime.from(HumanizeTime.java:130) ~[humanize-time-0.1.2.jar:na]
at to.lova.humanize.time.HumanizeTime.fromNow(HumanizeTime.java:119) ~[humanize-time-0.1.2.jar:na]
at to.lova.humanize.time.HumanizeTime.fromNow(HumanizeTime.java:63) ~[humanize-time-0.1.2.jar:na]
at to.lova.humanize.time.HumanizeTime.fromNow(HumanizeTime.java:41) ~[humanize-time-0.1.2.jar:na]
If you attempt to format an Instant with:
you get an error: