Formatting js-joda Duration instance

786 Views Asked by At

I'd like to display a chrono of elapsed time since the beginning of an operation to a user. I create a Duration instance from a number of seconds, but then, I can't find a way to properly format it like 00:00:23. Do I have to manually get each time component (hours, minutes, seconds) and assemble them?

The Formatting section of the docs specifies that a DateTimeFormatter can only be passed to the format method of LocalDate, LocalTime, LocalDateTime, or ZonedDateTime instance, and Duration does not have such method.

0

There are 0 best solutions below