The error message is pretty clear. date()
function expects the parameter to be a long, but you're passing a SimpleXML object instead.
As is evident from the var_dump()
output $data->person[0]->date
is an object. To get just the timestamp part, you'd have to cast it to a string.
This is applicable everywhere. When working SimpleXML, you'd have to explicitly cast the object into a string in order to access the contents inside. For this particular case, the following should work:
echo date('Y-m-d H:i:s', (string) $data->person[0]->date);