We propose an implicit finite-difference method to study the time evolution of the director field of a nematic liquid crystal under the influence of an electric field with weak anchoring at the boundary. The scheme allows us to study the dynamics of transitions between different director equilibrium states under varying electric field and anchoring strength. In particular, we are able to simulate the transition to excited states of odd parity, which have previously been observed in experiments, but so far only analyzed in the static case.