Kirk was generally accepted as being in his 30's during TOS so he would have been in the service at the same time as Spock was with Pike.
'If the Apocalypse starts, beep me!' - Buffy Summers
'The sky's the limit.....' Jean-Luc Picard, 'All Good Things'
courtesy of Saquist