Myopia (near-sightedness) is an important public health issue. Spending more time outdoors can prevent myopia but the long-term association between this exposure and myopia has not been well characterised. We investigated the relationship between time spent outdoors in childhood, adolescence and young adulthood and risk of myopia in young adulthood. The Kidskin Young Adult Myopia Study (KYAMS) was a follow-up of the Kidskin Study, a sun exposure-intervention study of 1776 children aged 6–12 years. Myopia status was assessed in 303 (17.6%) KYAMS participants (aged 25–30 years) and several subjective and objective measures of time spent outdoors were collected in childhood (8–12 years) and adulthood. Index measures of total, childhood and recent time spent outdoors were developed using confirmatory factor analysis. Logistic regression was used to assess the association between a 0.1-unit change in the time outdoor indices and risk of myopia after adjusting for sex, education, outdoor occupation, parental myopia, parental education, ancestry and Kidskin Study intervention group. Spending more time outdoors during childhood was associated with reduced risk of myopia in young adulthood (multivariable odds ratio [OR] 0.82, 95% confidence interval [CI] 0.69, 0.98). Spending more time outdoors in later adolescence and young adulthood was associated with reduced risk of late-onset myopia (≥ 15 years of age, multivariable OR 0.79, 95% CI 0.64, 0.98). Spending more time outdoors in both childhood and adolescence was associated with less myopia in young adulthood.