At the height of his career, in 1982, the thirty-year-old Khan took over the captaincy of the Pakistan cricket team from Javed Miandad. As a captain, Khan played 48 Test matches, out of which 14 were won by Pakistan, 8 lost and the rest of 26 were drawn. He also played 139 ODIs, winning 77, losing 57 and ending one in a tie.  In the team's second match, Khan led them to their first Test win on English soil for 28 years at Lord's. Khan's first year as captain was the peak of his legacy as a fast bowler as well as an all-rounder. He recorded the best Test bowling of his career while taking 8 wickets for 58 runs against Sri Lanka at Lahore in 1981-1982. He also topped both the bowling and batting averages against England in three Test series in 1982, taking 21 wickets and averaging 56 with the bat. Later the same year, he put up a highly acknowledged performance in a home series against the formidable Indian team by taking 40 wickets in six Tests at an average of 13.95. By the end of this series in 1982-1983, Khan had taken 88 wickets in 13 Test matches over a period of one year as captain. This same Test series against India, however, also resulted in a stress fracture in his shin that kept him out of cricket for more than two years. An experimental treatment funded by the Pakistani government helped him recover by the end of 1984 and he made a successful comeback to international cricket in the latter part of the 1984-1985 season.  In India in 1987, Khan led Pakistan in its first-ever Test series win and this was followed by Pakistan's first series victory in England during the same year. During the 1980s, his team also recorded three creditable draws against the West Indies. India and Pakistan co-hosted the 1987 World Cup, but neither ventured beyond the semi-finals. Khan retired from international cricket at the end of the World Cup. In 1988, he was asked to return to the captaincy by the president of Pakistan, General Zia-Ul-Haq, and on 18 January, he announced his decision to rejoin the team. Soon after returning to the captaincy, Khan led Pakistan to another winning tour in the West Indies, which he has recounted as "the last time I really bowled well". He was declared Man of the Series against West Indies in 1988 when he took 23 wickets in 3 Tests. Khan's career-high as a captain and cricketer came when he led Pakistan to victory in the 1992 Cricket World Cup. Playing with a brittle batting line-up, Khan promoted himself as a batsman to play in the top order along with Javed Miandad, but his contribution as a bowler was minimal. At the age of 39, Khan took the winning last wicket himself.

Answer this question "When was he a captain there?" by extracting the answer from the text above.
1982,