endpoints function

Locate endpoints by time