Gardenhire, 59, revealed the diagnosis in a meeting with reporters on Tuesday, saying it was the only time he would talk publicly about the subject this spring.
Gardenhire said he received the diagnosis about a week ago, after tests in Minnesota. He will undergo surgery to remove the prostate gland, probably during the second week in April.
He said doctors believe they caught the cancer early and that the surgery would leave him cancer-free.
Gardenhire managed the Twins for 13 seasons before being fired after the 2014 season.
He was special assistant to Twins general manager Terry Ryan last year before being hired as the top assistant to new Diamondbacks manager Torey Lovullo.