Complex life cycles are characterized by niche shifts at the time of metamorphosis. Current models predict optimal sizes for metamorphosis based on maximizing growth, minimizing mortality, or some balance of these goals. These models predict optimal sizes that are independent of the time of metamorphosis. Reproduction and other major events in the life history of organisms are often constrained to seasons, and the state (e.g., mass) of the organism at that time is related to fitness. Therefore, an organism's state as well as the time that that state is achieved are central variables in these time-constrained life histories. We extend earlier theory to include explicit time constraints in three, hypothetical, complex life cycles. Dynamic optimization models are constructed to determine optimal time and mass trajectories for niche shifts. First, we consider the habitat shift at emergence in mayflies, where reproduction terminates a growth period in the first habitat and is constrained to a season. Second, we consider the habitat shift at metamorphosis in amphibians, where reproduction terminates a growth phase in the second habitat and reproduction is constrained to a single point in time. Third, we combine the first two effects to allow an extended period of reproduction in amphibians. Here optimal time and mass trajectories are determined for two niche shifts-the shift from aquatic to terrestrial habitat and the shift from a growth phase to a reproductive phase. We present analytical theory that allows both quantitative and qualitative predictions. Problem constructions and solutions are presented graphically to aid intuition in interpreting our results and extending the framework to other parameter values and other life-history examples. The general conclusion is that time constraints on complex life histories lead to optimal sizes for niche shifts that vary with time. In time-constrained life histories, any variation in the state of individuals at some time prior to reproduction will be preserved to some degree at reproduction. Therefore, in time-constrained life histories, we expect optimal switches in habitat use or life history stage to depend not only on state but also on the time that state is achieved.