Fixed formatTimestamp() and added formatTime().