only starttime or endtime works