update time, javascript