he did spend a few hours close to gargantua
John's age is affected by the same ambiguities as all beings who undergo extended voyages through space. Though he is chronologically 47 years old as of mid-2558, he has spent much of his life in cryosleep, particularly when he spent almost five years adrift aboard Forward Unto Dawn. Cellular activity is slowed to near standstill in cryosleep, effectively halting the aging process. As a result, John's biological age is significantly less than his age as measured by Terran chronology.
http://www.halopedia.org/John-117#Age_and_appearance
If he has really spent most of his life in cryosleep than he is technically under 23.5 years old.