Add join by timestamp function