Q:

PHPExcel date without dash, slash or else

I use a excel template with cell-format in column L as "custom" -> ddmmyyyy
From php page I call PHPExcel object and fill as follow:
$objPHPExcel->setActiveSheetIndex(0)
->setCellValueExplicit('L'.$i, $birthdate, PHPExcel_Cell_DataType::TYPE_STRING);

(in a loop but that is of no importance for the issue).  
The value $birthdate contains dates with a dash.  And that is exactly as I want it to be...almost...=>
When the cells have been written and I open the excel file, I see all dates are
displayed in this format: dd-mm-yyyy
However, the cell-format of each cell in column L in that file is still "custom" -> ddmmyyyy
So I would expect the cells to show as ddmmyyyy...
Why is it still showing the dashes although cellformat is ddmmyyyy ? 
Furthermore...when I click behind the date in the value bar (that field behind fx), and then press ENTER, then all of a sudden, the cell displays the date as ddmmyyyy...
Why not on opening the file?  And how to solve it? 

A:

Accidentally found the solution...put the date to 00:00:00 UTC =>

$date = DateTime::createFromFormat('d-m-Y', $birthdate);
$birthdate  = $date->format('d-m-Y')."  00:00:00";
date_default_timezone_set("UTC");
$timestamp = strtotime($birthdate);
$dateValue = $timestamp;

    $objPHPExcel->getActiveSheet(0)
        ->setCellValue('L'.$i, PHPExcel_Shared_Date::PHPToExcel($dateValue));

