Time-shift experiments provide measures of the mean fitness of a population in environments of different points in time. Here, we show how to use this type of data to decompose mean fitness into (1) the effect of the environment in which the population is transplanted, (2) the effect of the genetic composition of the population and (3) ‘temporal adaptation’, which measures how the population fits the environment at that time. We derive analytical results for the pattern of ‘temporal adaptation’ and show that it is in general maximal in the recent past. The link between ‘temporal adaptation’ and ‘local adaptation’ is discussed, and we show when patterns of adaptation in time and space are expected to be similar. Finally, we illustrate the potential use of this approach using a data set measuring the adaptation of HIV to the immune response of several recently infected patients.