Common function for timestamp conversion.
Add WriteProgressToFile.