title: PHPExcel Date Format
body: <p>I am getting an output from MS SQL server in the '2012-08-09 00:00:00' (without quotes) format.</p>
  
  <p>However, when I write it to excel file I'm unable to write it in date format to have dd mmm yyyy formatting on excel.</p>
  
  <p>As a result i tried to write in format =date(2012,08,09) as a formula to the respective cells.</p>
  
  <p>But I don't want to output it as a formula but rather the value '09 Aug 2012' with the data type integrity intact. How do I do this? Or is there a simpler method?</p>
  
  <p>I read through the documentation but it was not clear to me, thought I would ask for clarification.</p>
  
  <p>Regards.</p>
  
  <hr>
  
  <p>Sorry for not being detailed enough.</p>
  
  <p>I am using the PHPExcel library.</p>
  
  <p>From my sql array, i use the following:</p>
  
  <pre><code>$t_year    = substr($xls_column_datas["colname"],0,4);
  $t_month   = substr($xls_column_datas["colname"],5,2);
  $t_day     = substr($xls_column_datas["colname"],8,2);
  $t_format  = $t_year . "," . $t_month . "," . $t_day ;
  $t_format  = '=date('.$t_format.')';
  
  $objPHPExcel-&gt;getActiveSheet()-&gt;setCellValueByColumnAndRow($data_column_num, $data_row_num, $t_format );
  $objPHPExcel-&gt;getActiveSheet()-&gt;getStyleByColumnAndRow($data_column_num, $data_row_num)-&gt;getNumberFormat()-&gt;setFormatCode('[$-C09]d mmm yyyy;@');
  </code></pre>
  
  <p>in my excel output, it shows column A2 for e.g. =DATE(2012,8,9) </p>
  
  <p>rather than showing up as a formula I want excel to recognize '2012-08-09 00:00:00'  is a date time and format it to dd mmm yyyy.</p>
  
  <p>Is this getting clear? Sorry.</p>