Here’s the best piece of advice you’ll get all day: Go to the park.

According to a new study by researchers at the University of Vermont, city dwellers can not only overcome crankiness by spending time at a public park, but they can also be rewarded with a happiness boost akin to the jolt of euphoria one might get on Christmas morning.

What’s more, they found, people’s moods started to improve just from the anticipation of a park outing, and the afterglow of increased happiness subsisted several hours afterward. They also found that while any sort of outdoor public gathering space boosted people’s happiness, large parks with lots of vegetation seemed to provide the biggest benefit.

“Being in nature offers restorative benefits on dimensions not available for purchase in a store or downloadable on a screen,” said Christopher Danforth, one of the study’s co-authors.

The study relies on a tool developed by researchers called the Hedonometer, which measures the sentiment of tweets based on the words they contain. Words such as “laughter,” “rainbow” and “love” have a strong positive association, while “murder,” “terrorist” and “cancer” clearly do not. Others such as “indicate,” “dwell” and “me” don’t carry any innate emotional valence one way or another.

Like any sentiment-analysis tool, it’s not perfect. It doesn’t attempt to understand contextual clues that can change the interpretation of a word or indicate whether it’s being used sarcastically, for instance. However, research has shown that it does a good job of measuring the sentiment of a large corpus of text.

The researchers collected all geo-tagged Twitter posts originating in San Francisco between May and August of 2016. This allowed them to determine whether the tweet was sent from within a city park or elsewhere. They then measured the collective sentiment of those tweets, as well as tweets sent before and after the park visits.

On a scale of one (least happy) to nine (most happy), tweets sent from parks had a sentiment of about 6.43, or an increase of about 0.229 points relative to those sent from someplace else. For a sense of the magnitude, that’s equivalent to the happiness increase the Hedonometer finds among Twitter users on Christmas Day — the happiest day of the year by its calculations.

The researchers found words such as “beautiful,” “sun” and “happy” were much more common in park tweets. The posters were also less likely to use negative words such as “not” and “don’t” or first-person pronouns like “I” or “me.”

Twitter, of course, isn’t representative of the entire U.S. population. Its users may be different from everyone else in ways that would alter the findings of this study, for instance. Also, people who take the time to fire off a tweet in the middle of a park visit may not even be representative of Twitter users as a whole. Still, as a tool for measuring the real-time thoughts and actions of millions of people, Twitter is essentially unparalleled.

“This pattern supports prior work describing nature exposure as an opportunity to shift from an individual to collective mental frame, potentially leading to prosocial behaviour,” the authors wrote. Research published in 2014, for instance, found that people exposed to particularly beautiful natural organisms or environments were more likely to exhibit generous or trusting tendencies, and to be more agreeable and more empathetic.

Research has shown that people who live in cities tend to be less happy than people elsewhere, with rates of mental illness higher in cities as well. The University of Vermont study suggests that urban green spaces can help counteract these trends, and that they confer a benefit to city residents that goes beyond dollars and cents.

“A big focus in conservation has been on monetary benefits, like, ‘How many dollars of flood damage did we avoid by restoring a wetland?’ ” said co-author Taylor Ricketts. “But this study is part of a new wave of research that expands beyond monetary benefits to quantify the direct health benefits of nature.”

The finding that the biggest happiness boosts came from bigger, wilder spaces with a greater diversity of species on display also has profound implications at a time when global biodiversity is plummeting as humans usher in the planet’s sixth mass extinction. It suggests a benefit to wildlife and landscape conservation that isn’t reflected in economists’ calculations of the cost of those efforts.

The study suggests that a world with fewer wild species and fewer places to experience them will be a sadder one than the one we live in today. So, as previously mentioned, go outside and visit a park.