The goal of digital quantum simulation is to approximate the dynamics of a given target Hamiltonian via a sequence of quantum gates, a procedure known as Trotterization. The quality of this approximation can be controlled by the so called Trotter step, that governs the number of required quantum gates per unit simulation time, and is intimately related to the existence of a time-independent, quasilocal Hamiltonian that governs the stroboscopic dynamics, refered to as the Floquet Hamiltonian of the Trotterization. In this work, we propose a Hamiltonian learning scheme to reconstruct the implemented Floquet Hamiltonian order-by-order in the Trotter step: this procedure is efficient, i.e., it requires a number of measurements that scales polynomially in the system size, and can be readily implemented in state-of-the-art experiments. With numerical examples, we propose several applications of our method in the context of verification of quantum devices, from the characterization of the distinct sources of errors in digital quantum simulators to the design of new types of quantum gates. Furthermore, we show how our approach can be extended to the case of non-unitary dynamics and used to learn Floquet Liouvillians, thereby offering a way of characterizing the dissipative processes present in NISQ quantum devices.