Editor’s note: Tara Cottrell is a writer and digital strategist, and works as the web content manager at Stanford University’s Graduate School of Business. Dan Zigmond is a writer, data scientist and Zen priest, and is director of analytics for Facebook. They are the authors of the book Buddha’s Diet.

More than two millennia ago, wandering the footpaths of ancient India, preaching in village huts and forest glens, Buddha was biohacking his health. He tried holding his breath so long his ears exploded, and even the gods assumed he was dead. (He wasn’t.) He then tried extreme fasting, reducing down his daily meals until he was living on just a few drops of soup each day. He got so thin his arms looked like withered branches and the skin of his belly rested on his spine.

Buddha was trying to do what we’re all trying to do on some level — improve ourselves and stop suffering so much, sometimes by employing pretty far-fetched techniques. But in the end, he rejected all these crazy extremes — not because they were too hard, but because they just didn’t work.

Buddha believed in data. Every time he tried something new, he paid attention. He collected evidence. He figured out what worked and what didn’t. And if something didn’t work, he rejected it and moved on. A good scientist knows when to quit.

When Buddha started teaching, he advised his students to do the same. He didn’t ask anyone to take his instructions on faith. He explained that the way most other teachers insisted you believe everything they said was like following a procession of blind men: “the first one does not see, the middle one does not see, and the last one does not see.” Buddha didn’t want us to trust — he wanted us to see. Our beliefs should be based on data.

He applied this same thinking to food. Most religions include some sort of dietary restriction: Islam prohibits pork. Orthodox Jews refrain from mixing milk and meat. Catholics avoid certain foods during Lent. Some devout Hindus won’t eat anything stale or overripe or with the wrong flavors or texture. Usually these rules are presented as divine commandments. Asking why we should eat this way is beside the point. There isn’t necessarily a reason for the commandment — the commandment is the reason.

Buddha took a different approach: His rules were grounded in his own experience. Like a lot of us, he tried some crazy diets. But what worked for him was very simple. He gave little advice about what his monks should eat, but he was very particular about when they should eat it. His followers were basically free to eat anything they were given — even meat — but only between the hours of dawn and noon.

Like any good data scientist, Buddha learned to ignore the outliers.

Buddha didn’t give a mystical or supernatural explanation for this odd time restriction. But he was pretty sure it would improve their health. He had tested it on himself. “Because I avoid eating in the evening, I am in good health, light, energetic, and live comfortably,” he explained. “You, too, monks, avoid eating in the evening, and you will have good health.”

If Buddha were alive today, he’d be surprised to see so many Silicon Valley techies and Brooklyn hipsters embracing intermittent fasting as a new craze. But he’d be gratified to see the evidence mounting for the health benefits he claimed for time-restricted eating. We now have numerous scientific studies confirming the original data Buddha collected.

In 2014, for example, Dr. Satchidananda Panda and his team of researchers at the prestigious Salk Institute for Biological Sciences outside San Diego published a study on obesity in mice. They took one group of mice and instead of their normal food, offered them a diet of high-fat, high-calorie foods — and let them eat as much as they wanted. The results would surprise no one: The mice got fat.

Then they took another group of mice and offered them exactly the same seemingly unhealthy diet, but this time they only let the mice eat for nine to 12 hours each day. During the rest of the day and at night, the mice got only water. In other words, these mice had the same all-you-can-eat buffet of tasty, fattening treats. The one rule was that they could only stuff themselves during some of their waking hours.

This time, the results were a surprise: None of these mice got fat. Something about matching their eating to their natural circadian rhythms seemed to protect the mice against all that otherwise fattening food. It didn’t matter if they loaded up with sugars and fats and other junk. It didn’t seem to matter what the mice ate, or even how much of it, only when they ate it.

In other words, the data backed up Buddha.

Other scientists have produced similar results. Dr. Panda’s team even tried fattening up the mice by starting them on that first any-time diet, and then switched them to the time-restricted version. These mice didn’t just stop gaining — they started to lose that excess weight.

Every day becomes a balance, with a time for eating and a time for fasting.

And it doesn’t stop with mice. Researchers have asked men and women to restrict their eating to certain hours each day, and those people lose weight, too.

Some of the best researchers studying food and health have been confirming Buddha’s original rules. Whether you call it intermittent fasting or time-restricted eating, Buddha’s ancient biohacking wasn’t an anomaly. The data he collected on himself has now been replicated by countless others.

Like any good data scientist, Buddha learned to ignore the outliers. He realized early on that the truth is rarely found in the extremes. He practiced instead the “middle way,” a philosophy of perpetual compromise and moderation. Modern time-restricted diets follow this same sane path — not quite dieting, but not quite eating anything any time either . Every day becomes a balance, with a time for eating and a time for fasting.

These days, we can all do what Buddha did: Become your body’s own data scientist; observe yourself as you eat to see what works for you and what doesn’t. We weren’t designed to eat at all hours, an unfortunate luxury we have with all the cheap and readily available food in first-world countries. Buddha discovered this long ago. Now we know it too.