וַ֠יִּפְקֹד שַׂ֣ר הַטַּבָּחִ֧ים אֶת־יוֹסֵ֛ף אִתָּ֖ם וַיְשָׁ֣רֶת אֹתָ֑ם וַיִּהְי֥וּ יָמִ֖ים בְּמִשְׁמָֽר׃
И начальник стражи поручил Иосифу быть с ними, и он служил им; и они продолжили сезон в палате.
Tur HaArokh
ויהי מקץ שנתים ימים, “it was at the end of two years.” Pharaoh’s dream occurred two years after the reinstatement of the chief of the cupbearers. Although the Torah did not specify when the two years which it describes as having ended commenced, it is reasonable to assume that they commenced at the time the cupbearer had been released. The Torah implies that although the time had come then for Joseph to be released also, the fact that he pinned his hopes on the goodwill of the cupbearer whose good fortune he had foretold caused G’d to keep him in jail for another two years. As a result, he spent a total of 12 years in jail. He had served in the house of Potiphar for only one year. We arrive at this conclusion by the verse which says “the blessing of G’d was on the house of the Egyptian both in the field and in the house, the field being a reference to the summer, and “the house” being a reference to winter, the season when most people in temperate climates spend most of their time indoors. He had already been in jail for 9 years before the king’s prisoners joined him there. This is clear from the verse (Genesis 40,4) “they had been in jail for one year.” (a reference to the two ministers.) These ten years were followed by another two years that ended at the beginning of our portion. This account is difficult to reconcile with a statement in the Midrash Hagadol on Genesis 40,1 that the cupbearer and the chief baker sinned [in the sense that the Satan encouraged them to sin, Ed.] in order that they should have reason to bemoan their own fates instead of slandering Joseph, etc.” If the Midrash is correct, it is strange that they were not jailed many years previously. Perhaps one could say that though both the cupbearer and the chief baker committed a variety of sins against their king much earlier, the identity of these sinners had not been discovered until much later so that they were not jailed until Joseph had already been in jail for nine years.
Sforno
סריסי פרעה אשר אתו במשמר בית אדוניו, seeing that his master had entrusted their well being to him, as we know from verse 4 “the official in charge appointed Joseph to be with them.” If it had not been for this, it would not have been appropriate for Joseph to enquire into the private affairs of these ministers awaiting their final sentence.
Sforno
סריסי פרעה אשר אתו במשמר בית אדוניו, seeing that his master had entrusted their well being to him, as we know from verse 4 “the official in charge appointed Joseph to be with them.” If it had not been for this, it would not have been appropriate for Joseph to enquire into the private affairs of these ministers awaiting their final sentence.