I think these changes will help.
Function:
To display,
The reason I used return in the function is because date returns a string, so you want you function to do the same.
The display part, I used <?= ShowDate(); ?> instead of <?php ShowDate(); ?> because the <?= means to display the result (echo).
You can also have it like this:
Function:
To display,
Both way works.

You just need a way to echo the data somewhere.