[threeten-develop] Duration
Status: Alpha
Brought to you by:
scolebourne
From: James G. <jp...@gm...> - 2012-07-01 12:23:16
|
Hi, I'm playing around with the API and am not sure if I am approaching this problem in the right way: LocalDate warBegins = LocalDate.of(1939, 9, 1); LocalDate warEnds = LocalDate.of(1945, 9, 2); Duration duration = Duration.between(Instant.from(warBegins), Instant.from(warEnds)); So from this duration I now want to start inspecting it to get the information that the duration was 6 years and 1 month. I can see a useful way to get time using the .get(java.util.concurrent.TimeUnit) method, but then I would need a manual conversion over to years? It is possible I am missing something in the API here? Thanks, Jim |