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

New Post: How to read just a date from excel into MySql?

$
0
0

Hello,

I'm searching this forum and the documentation but I do not understand how to implement of reading just a date.

I have version 1.7.7.

I maintain a volleybal site and I have different Excel file's for the council members to maintain members, commissions, teams etc. and import these data in a MySQL file.

I have moderate the file Iterator.php so that it is working for excel 5 and excel 2007. For text and a time value like '20:00' it is this working fine with:

$imp_data[$ic] = iconv("UTF-8", "ISO-8859-1", $cell->getFormattedValue());

But now I have a date in excel like '1-11-2012' and I have defined the cell properties with date '14-3-2001'.

I want to test a cell value if it is a date. If this is so then I want to import this into a mySQL database, for example like this:

$cell_tmp = 'A2';
if (PHPExcel_Shared_Date::isDateTime($cell_tmp)) {
   $imp_data[$ic]= PHPExcel_Style_NumberFormat::toFormattedString($cell->getValue(), "M/D/YYYY");
}

But this is not working.

Nico.


Viewing all articles
Browse latest Browse all 2707

Trending Articles



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