remove head and tail time interval