The roots of Groundhog Day go back to the Bible and perhaps even earlier.
The Romans considered February [the name comes from februa, to purify] as "a time of cleansing in preparation for a fresh start" because the month comes halfway between December 21, the first day of winter in the Northern Hemisphere, and March 21 (the Spring or Vernal Equinox).
The connection to the Bible is that in Hebrew tradition mothers were required to purify their children in the temple 40 days after giving birth.
Mary, mother of Jesus, purified Jesus on Feb. 2nd, 40 days after Jesus's birth, establishing the tradition of the "Feast of the Presentation."
The early Christians, working off of an earlier Roman tradition, associated February 2nd with the lighting of candles (i.e. "the bringing of new light") and established "Candlemas" as a Christian tradition. In the ancient Pagan world, Groundhog Day was known as Imbolc.
A Candlemas rhyme was developed to mark the occasion of the turning of the seasons, and the rhyme suggested that Candlemas itself was a kind of weather predictor:
Somewhere along the way the weather-predictive power of Candlemas came to be associated with badgers. No one is quite sure why, but it is probably due to pre-Christian Germanic tradition that associated the romantic roamings of this large weasel with the start of a slowly lengthening day.
In any case, when German and Dutch immigrants came to Eastern North America there were no badgers to be found, and so they transposed their badger tradition to the groundhog, which also burrowed in the ground and which also came out of hibernation at approximately the same period of time.
In 1887, Clymer H. Freas, city editor of the Punxsutawney Spirit newspaper in Punxsutawney, Pennsylvania came up with the idea of a "Punxsutawney Groundhog Club" as a kind of boosterism for his ill-begotten city (the name Punxsutawney means "place of sand flies").
It was a crazy idea, but perseverence paid off. Over the course of several years, story and ritual were heaped up, and the Punxsutawney Groundhog Club stoked the flames of a myth, claiming that "Punxsutawney Phil" was a legendary groundhog that never died and could predict the weather for six weeks in advance. If Punxsutawny Phil can see his shadow, so the legend goes, then six weeks of winter are supposedly at hand. Of course, that's not too big a leap: six weeks is approximately the time of the Spring Equinox (March 20th.)
In December of 2004, the 100-year-old civic boosterism of Clymer H. Freas came to its latest fruition when Congressman John Peterson (R-Pa.) managed to snake $100,000 in Federal funding out of Congress for a "Punxsutawney Weather Discovery Center".
The "grand opening" of the Punxsutawney Weather Discovery Center was Groundhog Day, 2006, but (you will be relieved to hear) it already has a home on the Web.
"If Candlemas be fair and bright,
Winter has another flight.
If Candlemas brings clouds and rain,
Winter will not come again."
(From the Terrierman blogger)