We study the deterministic time‐varying demand lot‐sizing problem in which learning and forgetting in setups and production are considered simultaneously. It is an extension of Chiu's work. We propose a near‐optimal forward dynamic programming algorithm and suggest the use of a good heuristic method in a situation in which the computational effort is extremely intolerable. Several important observations obtained from a two‐phase experiment verify the goodness of the proposed algorithm and the chosen heuristic method.