This work addresses the scheduling of continuous plants subject to energy constraints related to time-dependent electricity pricing and availability. Discrete-and continuous-time formulations are presented that can address these issues together with multiple intermediate due dates. Both formulations rely on the resource-task network process representation. Their computational performance is compared for the objective of total electricity minimization with the results favoring the discrete-time model due to the more natural way of handling such a wide variety of discrete events. In particular, it can successfully handle problems of industrial size. Nevertheless, the new continuous-time model is a major breakthrough since it is the first model of its type that is able to effectively incorporate time-variable utility profiles. When compared to a simple manual scheduling procedure, the proposed scheduling approaches can lead to potential electricity savings around 20% by switching production from periods of high to low electricity cost.