implemented setTime method