update time if it's not null