In the film Groundhog Day, weather forecaster Phil Connors arrives in Punxsutawney, Pennsylvania to cover Groundhog Day. As it happens, he finds himself caught in a loop in which he has to relive Groundhog Day over and over. At first, knowing there will be no consequences because he will wake up on the same day again, he decides to do whatever he wants. He binge drinks, eats what he wants, drinks and drives, sleeps around, and commits robbery. Later, he becomes so upset about reliving the same day that he tries to commit suicide, but it doesn't work. Finally, he decides to spend the day he can't escape improving himself and trying to do good deeds. He falls in love with Rita and accepts his fate of living the same day over and over.
When Phil changes his attitude toward reliving the same day, makes the most of it, gives of himself to help others, loves another person, and accepts his fate, he wakes up on February 3rd, the day after Groundhog Day.
From the point of view of attaining virtue and happiness, Phil learns an important lesson, one associated with Asian religions such as Taoism and Buddhism: the journey is the reward. Phil has a spiritual transformation in which he learns that a day is not something to rushed through en route to the next thrill, but important for itself. He learns that true happiness comes from living virtuously by helping others and making the most of the present time. He learns that living mindfully and well in the present moment, whatever that moment is, it the most important task he has in life.
Phil's fate is also similar to the reincarnation that religions like Buddhism and Hinduism teach. Those religions teach that people will be reborn and returned to earth for life after life until they learn the spiritual lessons that will get them to Nirvana. This is similar to Phil being "reborn" over and over on the same day until he discovers where life's meaning lies.