Add function to calculate true ts