More time-handling and formatting functions.