New formatTimestamp() function with reusability in mind.