A two-dimensional second-order topological superconductor exhibits a finite gap in both bulk and edges, with the nontrivial topology manifesting itself through Majorana zero modes localized at the corners, i.e., Majorana corner states. We investigate a time-reversal-invariant topological superconductor in two dimension and demonstrate that an in-plane magnetic field could transform it into a second-order topological superconductor. A detailed analysis reveals that the magnetic field gives rise to mass terms which take distinct values among the edges, and Majorana corner states naturally emerge at the intersection of two adjacent edges with opposite masses. With the rotation of the magnetic field, Majorana corner states localized around the boundary may hop from one corner to a neighboring one and eventually make a full circle around the system when the field rotates by $2pi$. In the end we briefly discuss physical realizations of this system.