reusable latestTimestamp function (used in two places)