Hi,
I'm not sur it answers the question, but you can just modify the line containing the DATE_FORMAT command, to ajust the format of the date like you want. Have a look at the DATE_FORMAT documentation
So you could (for example) change the line to :
DATE_FORMAT(FROM_UNIXTIME(p.timecompleted),'%Y/%m/%d') AS 'Completed Date',
HTH,
Séverin