The parashah opens “Vayhi mikeitz sh’nasayim yamim — and it was at the end of a pair of years of days”. After Yosef spent two years in prison, Par’oh’s dream leads the wine steward to remember Yosef and eventually leads to his redemption. But why does the pasuk say “sh’nasayim yamim”, rather than just “shenasayim”? 
Second, why is the term used here for the arrival of the denoted time “mikeitz”, at the endpoint (from “katzeh”, edge )? How does it differ from saying that the “z’man”, or “eis” (both meaning “time”) had arrived?
This duplication of terms for time is echoed in next week’s parashah, when Ya’akov describes his age to Par’oh as “The days of the years of my travels…”  as well as at the beginning of parashas Vayechi, in counting out Ya’akov avinu’s lifespan, “… And the days of Ya’akov was, the years of his life…”  The repetition implies that there are distinct concepts. Yom and shanah refer to different things.
Most ancient societies viewed time as cyclic. Among the motivations suggested  for the building of the Tower of Bavel was the fear that the flood was part of a 1,656-year cycle, and they would need to prepare for a second flood.
The position is understandable. Plato  concludes that since our means of measuring time was the cyclic movement of astronomical objects so must the time they define be cyclic. The month and its cycle of phases, the year and its cycle of seasons define a cycle of time. The seasonal cycle also shapes the farmer’s lifestyle into cycles. Time cannot be measured without a predictable repetition of events, be it the falling of grains of sand, the swing of a pendulum, the escapement of a clock, the vibration of a quartz crystal or the waves of light emitted by cesium atoms.
This mindset is alien to modern man. The contemporary western view of time is linear, a dimension — a progress from the primitive to the advanced. This notion that history progresses comes from Judaism, from our view of time as running from First Cause to Ultimate Purpose, a history spanning from Adam to the Messianic Era and beyond. This acceptance is an accomplishment of the Chashmona’i revolution against the Greek mindset. Linear time gives us a view of man in which he can redeem himself; he is not doomed to repeat the same mistakes over and over. On the other hand, Judaism simultaneously embraces a cyclic view of time. As the Hagaddah phrases the purpose of the seder, “A person is obligated to see himself as though he himself came out of Egypt.” Every Shavuos we are to accept the Torah anew. Our holidays not only repeat the cycle of the Exodus, they are tied to agricultural events and thereby the cycle of seasons. The holiday is both reliving the Sukkos of the desert as well as celebrating bringing in our crops. 
The Zohar  describes a system of grammatical gender follows the conventions of sexual reproduction: Biblical Hebrew uses masculine nouns for those things that we think of as initiators that start a process. Feminine nouns take that seed and develop it into something more complete and usable. “Yom”, being in the masculine is therefore an initiator. “Yom” represents a unit of progress. It is a unit of linear time, a progress from birth to death. The culmination of history is notably called “acharis hayamim”  and in the navi, “yom Hashem” .
In contrast, “shanah” is from the same root as “two”, “to repeat”, “to learn”, or “to change”, and perhaps even that of “to age” and “to sleep”, as in “venoshantem ba’aretz” .
Shanah speaks of a retreat. A person can actively embrace that retreat, use it as a chance to build on what one already has. Or, it can be a time when he simply is a victim of circumstance.
While there is a need for progress, there is also a need to step back, to review, to develop the idea into something we can incorporate within ourselves and can use as a basis for future growth. It can be a time to regain a balance between technological progress and one’s basic humanity and values. If he embraces and uses the time, then he has achieved productive review, “years of days”.
Perhaps this is why the Malbim  explains Ya’akov avinu’s reply to Par’oh as having two parts. To Par’oh’s question about years, he answers that he traveled this earth 130 years. About days, Ya’akov laments that he did not use his time as productively as did his fathers, “Few and insufficient were the days of my life’s years, and they never reached the days of the years of my forefather’s lives.” 
R’ Aharon Kotler zt”l commented to a student on the occasion of the birth of the student’s son about the phrase “The bris should be be’ito ubizmano”, using both “eis” and “z’man” to denote its proper time. Rav Aharon explained the difference. If the baby is healthy, then the bris is at the pre-decided time, on the eighth day. If not, then it will be at the right time for that individual baby. Ideally the bris would be at both.
A z’man is a time that comes according to a pre-scheduled appointment, ready or not. It is a point in a shanah, in cyclic time that runs its celestial heartbeat regardless of human action. And so, the repeat of the exodus is “Z’man Cheiruseinu”, our time of freedom. An eis is a landmark in the course of progression. And so, one is “kovei’ah ittim baTorah”, one sets aside times for Torah.
But neither a z’man nor an eis can represent the goal of the trip. Reflection without progress and progress without reflection as to its purpose does not get one to a meaningful goal. A keitz, an endpoint, can only come from both.
Yosef’s experience in the pit was not simply measured in years of survival, but also in personal progress. After the culmination, the qeitz, of shenasayim yamim, he was ready to emerge a leader.
 We find the exact same turn of phrase in Shmuel II 14:28 and Yirmiyahu 28:3. In all three cases, the time measured is one in which someone (here — Yosef, Avshalom in Shmuel II) or something (the utensils of the Beis HaMikdash in Yirmiyahu) was in hiding.
 C.f. Shemos 36:33, “And he made the middle bar to pass through the boards [of the Mishkan] from the katzeh to the katzeh.”
 Bereishis 47:8
 Ibid. v. 28. Notable is the use of singular “hayah” referring to the days.
 Bereishis Rabba 38:1, third opinion
 Timaeus 36c-d
 Vayikra 23:39,43
 Pinechas 249a-b
 Eg. Sukkah 52b
 Eg. Malachi 4:5
 Devarim 4:25
 Bereishis 47:8
 Bereishis 47:9