Refactored printing of timestamps.