Time in relativistic and nonrelativistic quantum mechanics