Time may only be an illusion of consciousness. After all past, present and future only exist in one’s living consciousness. Once death permanently claims ones consciousness all existence and concept of time evaporates. Indeed, the dead have no way of knowing that they, or the idea of time, ever existed.
Thus I suppose the idea of heaven and an afterlife is a desperate desire to want to gain a broader perspective on life and time beyond one’s fragile living senses.