Ashton Kutcher needed to spend time in the hospital for imitating the fruit-only diet of former Apple CEO Steve Jobs in his latest movie role in the biopic, “jOBS”.

According to mashable.com, the 34-year-old actor revealed this at the Sundance Film Festival, where the indie film about the tech luminary premiered.

Describing his “terrifying” ordeal to USA Today, Ashton said:"First of all, the fruitarian diet can lead to, like, some severe issues.”

"I ended up in the hospital like two days before we started shooting the movie. I was, like, doubled over in pain.

"My pancreas levels were completely out of whack, which was really terrifying ... considering everything,” he said.

Jobs, the co-founder of Apple, died from pancreatic cancer in 2011.

The movie, which garnered mixed reviews, opens in theaters April 19. It is not to be confused with another film being created by Sony Pictures, based on Walter Isaacson's biography of Jobs, iSteve.

In Isaacson's book, the author wrote about Jobs’s “fruition diet” and how a trip to an apple farm inspired his company's name. "Apple took the edge off the word 'computer,” the late entrepreneur had said in the book.

Actors who portray real people in films have been known to go on extreme diets.

Tom Hanks lost 55 pounds to resemble a stranded plane crash survivor in Cast Away, Charlize Theron gained 30 pounds to play a prostitute in Monster. And according to TheGuardian, Christian Bale is rumoured to have lived on coffee and one apple a day to achieve his emaciated physique in The Machinist.