A Discrete-Time Formulation of Hamiltonian Dynamics