fixed bug in formatTimestamp()