And in the thirty-seventh year of the exile of Jehoiachin king of Judah, in the twelfth month, on the twenty-seventh day of the month, Evil-merodach king of Babylon, in the year that he began to reign, graciously freed Jehoiachin king of Judah from prison.
2 Kings 25:27 ESV
Like Joseph, Jehoiachin was brought out of prison to fellowship with the king. This happened in the 37th year of Jehoiachin's exile. Joseph was freed when he was 30 years old and the 7 years of plenty ended in his 37th year.