Due to its important practical applications, temporal planning is of great research interest in artificial intelligence. Yet most of the work in this area so far is limited in at least two ways: it only considers temporally simple domains and it has restricted decision epochs as the potential happening time of actions. Because of these simplifying assumptions, existing temporal planners are in fact not complete. In this paper, we focus on these limitations, and propose an alternative view of temporal planning by investigating a new declarative semantics of PDDL. We then show a natural encoding of this semantics in a constraint programming setting. It turns out that this encoding unifies planning and scheduling, and captures most of the temporal expressiveness of PDDL. The resulting CSP-based temporal planner can solve more general planning problems than the current state-of-the-art.