Quantcast
Channel: PHPExcel Forum Rss Feed
Viewing all articles
Browse latest Browse all 2707

New Post: Cell Formatting issue

$
0
0

"28/10/2012 22:20" looks like a string value to me: Excel (like PHP itself) uses a serailised datetimestamp value for dates (though based on number of days since 1st January 1900 (PHP uses number of seconds since 1st January 1970.

So you need to convert your date/time strings to Excel timestamps:

Use the standard PHP date functions to convert your string to a PHP timetsamp value via the strtotime() function or DateTime::createFromFormat() to create a PHP DateTime object.

These can then be passed to PHPExcel's PHPExcel_Shared_Date::PHPToExcel() method to return an Excel timestamp that you can then store in that cell


Viewing all articles
Browse latest Browse all 2707

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>