Set time value properly.