Add function to get offset of an event.