WASHINGTON — People around the world are happiest in the morning, according to a US study on Thursday that analyzed hundreds of millions of messages on the microblogging site Twitter.

Cornell University sociologists used language software to detect the presence of positive words in 509 million tweets from 2.4 million users in 84 different countries over a two-year period.

Mood peaks were detected early in the day but began to dip mid-morning, about the time most people are starting their workdays.

Another positive peak was witnessed around midnight, followed by a "sharp drop in NA (negative affect, including distress, fear, anger, guilt, and disgust) during the overnight hours," said the study in the journal Science.

The highest numbers of good mood words indicating enthusiasm, delight, activeness, and alertness were found on Saturdays and Sundays, "which points to possible effects of work-related stress, less sleep, and earlier wake time."

Samples from predominantly Muslim countries where the weekends are on different days, such as the United Arab Emirates, showed the same patterns on Fridays and Saturdays as seen in other countries on Saturdays and Sundays.

English was the only language analyzed, though users came from across the globe.

However, modern technology's answer to every emotion -- the smiley or sad face emoticon -- was of little help in the analysis, because "usage was too sparse to be able to detect a consistent pattern," said the study.