A definition of gravitational energy is proposed for any theory described by a diffeomorphism-invariant Lagrangian. The mathematical structure is a Noether- current construction of Wald involving the boundary term in the action, but here it is argued that the physical interpretation of current conservation is conservation of energy. This leads to a quasi-local energy defined for compact spatial surfaces. The energy also depends on a vector generating a flow of time. Angular momentum may be similarly defined, depending on a choice of axial vector. For Einstein gravity: for the usual vector generating asymptotic time translations, the energy is the Bondi energy; for a stationary Killing vector, the energy is the Komar energy; in spherical symmetry, for the Kodama vector, the energy is the Misner-Sharp energy. In general, the lack of a preferred time indicates the lack of a preferred energy, reminiscent of the energy-time duality of quantum theory.