Ad
  • Default User Avatar

    Who has this problem don't belive Google about seconds and pay attention to this:

    For the purpose of this Kata, a year is 365 days and a day is 24 hours.

  • Custom User Avatar

    I didn't say that was the input value, the test is this:

    test.assert_equals(format_duration(132030240), "4 years, 68 days, 3 hours and 4 minutes")
    

    The input value for the test enj0x's code fails is 132030240. I don't know why enj0x used that other input value and that's why I told him to print it.

  • Default User Avatar

    Chrono79. I think you may be wrong

    4 years and 68 days in seconds is this

    ( ( 86400 * 365 ) * 4 ) + ( 86400 * 68 ) =
    132019200

    That number is bigger than the input (127246240)

    132019200 - 127246240 =
    4772960

    Using an online tool, https://www.calculatorsoup.com/calculators/conversions/time.php

    gives seconds to years as 4.03. If it was 68 days, it would be more like 4.186

    68 / 365 =
    .18630136986301369863

    Can you go back and check please ?

  • Custom User Avatar

    The tests are fine. Not a kata issue. It's 68 days btw, read the error message again and print the input to debug your code.