Insect larvae increase in size with several orders of magnitude throughout development making them more conspicuous to visually hunting predators. This change in predation pressure is likely to impose selection on larval anti-predator behaviour and since the risk of detection is likely to decrease in darkness, the night may offer safer foraging opportunities to large individuals. However, forsaking day foraging reduces development rate and could be extra costly if prey are subjected to seasonal time stress. Here we test if size-dependent risk and time constraints on feeding affect the foraging–predation risk trade-off expressed by the use of the diurnal–nocturnal period. We exposed larvae of one seasonal and one non-seasonal butterfly to different levels of seasonal time stress and time for diurnal–nocturnal feeding by rearing them in two photoperiods. In both species, diurnal foraging ceased at large sizes while nocturnal foraging remained constant or increased, thus larvae showed ontogenetic shifts in behaviour. Short night lengths forced small individuals to take higher risks and forage more during daytime, postponing the shift to strict night foraging to later on in development. In the non-seasonal species, seasonal time stress had a small effect on development and the diurnal–nocturnal foraging mode. In contrast, in the seasonal species, time for pupation and the timing of the foraging shift were strongly affected. We argue that a large part of the observed variation in larval diurnal–nocturnal activity and resulting growth rates is explained by changes in the cost/benefit ratio of foraging mediated by size-dependent predation and time stress.