However grumpy people are when they wake up, and whether they stumble to their feet in Madrid, Mexico City or Minnetonka, Minn., they tend to brighten by breakfast time and feel their moods taper gradually to a low in the late afternoon, before rallying again near bedtime, a large-scale study of posts on the social media site Twitter found.

Drawing on messages posted by more than two million people in 84 countries, researchers discovered that the emotional tone of people’s messages followed a similar pattern not only through the day but also through the week and the changing seasons. The new analysis suggests that our moods are driven in part by a shared underlying biological rhythm that transcends culture and environment.

The report, by sociologists at Cornell University and appearing in the journal Science, is the first cross-cultural study of daily mood rhythms in the average person using such text analysis. Previous studies have also mined the mountains of data pouring into social media sites, chat rooms, blogs and elsewhere on the Internet, but looked at collective moods over broader periods of time, in different time zones or during holidays.

“There’s just a torrent of new digital data coming into the field, and it’s transforming the social sciences, creating new lenses to look at all sorts of behaviors,” said Peter Sheridan Dodds, a researcher at the University of Vermont who was not involved in the new research. He called the new study “very exciting, because it complements previous findings” and expands on what is known about how mood fluctuates.