Custom Date Format Possible Bug?

Topics: Developer Forum
Sep 27, 2011 at 9:52 PM
Edited Sep 28, 2011 at 3:00 AM


I have a short function that converts a local excel document (2003) into HTML, see below: 

		*	Convert a local Excel file to HTML and return HTML:
		public static function getConvertExcelToHTML($filename) {

			//Needs IO Factory
			require_once 'PHPExcel/IOFactory.php';

			//Check to make sure file exists
			if (!file_exists($filename)) {
				appCore::error("Cannot find $filename");

			//Load File
			$objPHPExcel = PHPExcel_IOFactory::load($filename);

			//WRite the sheet to file
			$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'HTML');

			//Display Settings:

			//Get the active sheet
			$objWorksheet = $objPHPExcel->getActiveSheet();

			//Set writer to active sheet:

			$filename = str_replace('.xlsx', '.htm', $filename);
			$filename = str_replace('.xls', '.htm', $filename);

			//Return the Cached file:
			return file_get_contents($filename);

But for cells with a date format (i.e. "6 meses adelante"  (mmmm yyyy)) the PHPExcel garbles the output, please see image here with the excel VS PhpExcel (

The excel document is here:

My host is running PHP Version 5.2.17, Linux

Is this a bug or am I loading it wrong?

Thank you