format the timestamp appropriately