gsraman / php-excel-reader

Automatically exported from code.google.com/p/php-excel-reader
0 stars 0 forks source link

MM/DD/YY format dates output as (e.g.) "JanJan/ThuThu/19701970" #32

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Upload a spreadsheet with a date column in MM/DD/YY format
2. Parse spreadsheet with php-excel-reader
3. date column output as "JanJan/ThuThu/19701970"

What is the expected output? What do you see instead?

I would expect to see "01/01/1970"

Original issue reported on code.google.com by popefe...@gmail.com on 2 Jul 2009 at 7:33

GoogleCodeExporter commented 8 years ago
Are you using OpenOffice? If so, please see other issues and the discussion 
forum.

Original comment by matthew....@gmail.com on 2 Jul 2009 at 7:40

GoogleCodeExporter commented 8 years ago
Yes, I am using OOo.  I'll see if that happens w/ a file from Excel.

Original comment by popefe...@gmail.com on 2 Jul 2009 at 9:28

GoogleCodeExporter commented 8 years ago
Matthew: thanks for a great lib!

I ran into the same problem above (indeed using OO).

Fixed it by switching str_replace to str_ireplace on line 1257 and 1260 
(version 2.21).

Maybe not the cleanest way, but this way the OO issue goes away for me ;)

Original comment by piet.hon...@gmail.com on 13 Sep 2009 at 3:37

GoogleCodeExporter commented 8 years ago
have the same issue here (using OO and having 2.21 version of the script);

piet.honkoop's solution only works with php >= 5 if you are still using some 
older
version you may reach the same result by using strtolower() on the $formatstr
variable at the lines 1257 and 1260

I think this is easy to fix in next releases

Original comment by fabio.mo...@gmail.com on 19 Nov 2009 at 6:11

GoogleCodeExporter commented 8 years ago
I don't plan to make any new releases, sorry! I've got many other projects to 
work
on, and supporting OO is not something I particularly care about.

I would love to have a group of people take ownership of this project and 
continue
improving it, since it is a very useful library, IMO.

Original comment by matthew....@gmail.com on 19 Nov 2009 at 6:21

GoogleCodeExporter commented 8 years ago
yes, it is. Maybe my company can take the ownership of the project and continue
supporting and improving it, obviously still as free and fully open-source 
software.

Can be an idea, will ask for it. What do you think?

Original comment by fabio.mo...@gmail.com on 28 Nov 2009 at 2:21

GoogleCodeExporter commented 8 years ago
I would like to take ownership of this project if you dont mined...

I am sing it quite a bit, need many changes to it.

Original comment by sirsh...@gmail.com on 22 Dec 2009 at 9:42

GoogleCodeExporter commented 8 years ago
Hi Im Sanoj

Original comment by sanojbog...@yahoo.com on 11 Oct 2012 at 2:57

GoogleCodeExporter commented 8 years ago
I found the solution 

********************************************************************************
***************
********************************************************************************
***************
********************************************************************************
***************
********************************************************************************
***************
SOLUTION
********************************************************************************
***************
********************************************************************************
***************
********************************************************************************
***************

Original comment by sanojbog...@yahoo.com on 11 Oct 2012 at 2:57

GoogleCodeExporter commented 8 years ago
GO TO reader.php and look for isDate() function. and replace 

$this->curformat = $this->formatRecords['xfrecords'][$xfindex]['format'];   
lines with

$this->curformat = 'Y-m-d';     this line.

Quick fix! 

Original comment by sanojbog...@yahoo.com on 11 Oct 2012 at 2:59

GoogleCodeExporter commented 8 years ago
I haveasame problem and my solved has been in excel_reader2.php at line: 1267 
replace with " $xf['format'] = 'd-m-Y' ";

Bye Silviu!

Original comment by tot...@gmail.com on 13 Nov 2012 at 2:12

GoogleCodeExporter commented 8 years ago
for me when the cells of the excel files aren't string it saves all the data in 
the database like this 1970-01-01 00:00:00
which is of course not right , i've tried all the solutions above but nothing 
worked :S

Original comment by rami.ema...@gmail.com on 29 May 2013 at 1:32

GoogleCodeExporter commented 8 years ago
yeah.same with me..i've tried all the solutions above but nothing worked

Original comment by pensilh...@gmail.com on 10 Jul 2013 at 7:18

GoogleCodeExporter commented 8 years ago
it works but has bug(it read date plus one day)
if i want to convert 00/2222/13131313 it will converted to 22/07/2013 but real 
value 
is 21/07/2013

Original comment by AhmedSwa...@gmail.com on 21 Aug 2013 at 11:13

GoogleCodeExporter commented 8 years ago

I have same issue in version 2.21

Original comment by developm...@mvixusa.com on 14 Nov 2013 at 12:24

Attachments:

GoogleCodeExporter commented 8 years ago
I am also facing the same problem.

Original comment by coolnikh...@gmail.com on 19 Nov 2013 at 7:28