1: \begin{abstract}
2: We study the complexity of the \emph{valued} constraint satisfaction problem (VCSP) for every valued structure with the domain ${\mathbb Q}$ that is preserved by all order-preserving bijections. Such VCSPs will be called \emph{temporal}, in analogy to the (classical) constraint satisfaction problem: a~relational structure is preserved by all order-preserving bijections if and only if all its relations have a~first-order definition in $({\mathbb Q};<)$, and the CSPs for such structures are called \emph{temporal} CSPs.
3: Many optimization problems that have been studied intensively in the literature can be phrased as a~temporal VCSP.
4: We prove that a~temporal VCSP is in P, or NP-complete. Our analysis uses the concept of \emph{fractional polymorphisms}; this is the first dichotomy result for VCSPs over infinite domains which is complete in the sense that it treats \emph{all} valued structures with a~given automorphism group.
5: \end{abstract}
6: