How to find timestamp of an event with specific time interval

#1

Using sparksql how to code an timestamp of interval in an event.