Time update function and Time lib