implement a set time function