Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GoogleCodeExporter opened this issue Apr 21, 2016 · 16 comments
Open

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 2 Jul 2009 at 7:33

@GoogleCodeExporter
Copy link
Author

Are you using OpenOffice? If so, please see other issues and the discussion 
forum.

Original comment by [email protected] on 2 Jul 2009 at 7:40

@GoogleCodeExporter
Copy link
Author

Yes, I am using OOo.  I'll see if that happens w/ a file from Excel.

Original comment by [email protected] on 2 Jul 2009 at 9:28

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 13 Sep 2009 at 3:37

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 19 Nov 2009 at 6:11

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 19 Nov 2009 at 6:21

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 28 Nov 2009 at 2:21

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 22 Dec 2009 at 9:42

@GoogleCodeExporter
Copy link
Author

Hi Im Sanoj

Original comment by [email protected] on 11 Oct 2012 at 2:57

@GoogleCodeExporter
Copy link
Author

I found the solution 

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

Original comment by [email protected] on 11 Oct 2012 at 2:57

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 11 Oct 2012 at 2:59

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 13 Nov 2012 at 2:12

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 29 May 2013 at 1:32

@GoogleCodeExporter
Copy link
Author

yeah.same with me..i've tried all the solutions above but nothing worked

Original comment by [email protected] on 10 Jul 2013 at 7:18

@GoogleCodeExporter
Copy link
Author

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 [email protected] on 21 Aug 2013 at 11:13

@GoogleCodeExporter
Copy link
Author


I have same issue in version 2.21

Original comment by [email protected] on 14 Nov 2013 at 12:24

Attachments:

@GoogleCodeExporter
Copy link
Author

I am also facing the same problem.

Original comment by [email protected] on 19 Nov 2013 at 7:28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant