appendDate function