Raza448 / php-excel-reader

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

Times formatted as "[h]:mm:ss" return ":mm:ss". #163

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Enter a time.
2. Format it as [h]:mm:ss.
3. Read it into php. Returns as :mm:ss. Query for format returns: ":i:s".

What is the expected output? What do you see instead?
Expect either hh:mm:ss if h!=0 or mm:ss or 0:mm:ss if h=0, not ":mm:ss".

Please provide any additional information below.
At line 1224 this project has added: $tmp = 
preg_replace("/^\[[^\]]*\]/","",$tmp);. Suggest: $tmp = 
preg_replace("/^\[([^\]]*)\]/","$1",$tmp);. I'm not sure why you would discard 
the values inside the [], it results in improper excel date formats. In limited 
tests I ran this change solved the problem. Please advise if you think I'm 
overlooking something, I'm certainly no expert on excel.

This is a massively useful project btw, thanks.

Original issue reported on code.google.com by snevetse...@gmail.com on 22 Jan 2013 at 5:02