Properly format duration