how to export date now excel

hy…
im try export excel on list page->page_datarendering event.
my code:
// Page Data Rendering event
function Page_DataRendering(&$header) {
// Example:
//$header = “your header”;
if (CurrentPage()->Export == “excel”) {
$header = “date(‘d-m-Y’);”;
}
}
not work.
I need to export excel with the current date.
is there something wrong with my code.
can anyone help?
thank you

Remove the quotes around the date function, if you want to get the actual date.

yes thanks very much

How to do?
$header = $variable;
It is necessary that the variable is exportedIn list this work, but not work in export.

https://discourse.hkvstore.com/t/phpspreadsheet-and-titles/723/1

This not work

if ($_REQUEST['x_id_property'] != '') {
$id_property = 'Prop: '.$_REQUEST['x_id_property'].'<br>'; } 
else {$id_property = '5';}
$header = "Property: {$id_property}";
}

In excel and pdf always displayed 5, although localhost/rent/r2_proplist.php?x_id_property=2&z_id_property=%3D&cmd=search

The URL parameters will not be passed to the URL automatically when you export, so $_REQUEST[‘x_id_property’] in your code does not have any value. However, you should be able to get the search value by checking:
$this->id_property->AdvancedSearch->SearchValue.

Thanks for the help, this works well.