Added API timediff functions