Update format function to add leading 0 to seconds