kenan77 / php-excel-reader

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

wrong value of time type field #140

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I am using 2.21 version.have time field in xls sheet and reader returning 
correct value on my local system like 11:00 am for 11:00 am in xls file but 
when i uploaded it to a server on net i returns wrong value like 4:00 pm for 
every entry less than 12 in the field and for the fields having value greater 
than 12 it i giving correct output .
it there any solution for this ?
please suggest 

Original issue reported on code.google.com by vikram.s...@g-axon.com on 3 Feb 2012 at 6:34

GoogleCodeExporter commented 8 years ago
Could you post the file please?

Original comment by endar...@gmail.com on 4 Feb 2012 at 4:40

GoogleCodeExporter commented 8 years ago
excel-reader file and the excel sheet both are attached....

Original comment by vikram.s...@g-axon.com on 5 Feb 2012 at 7:44

Attachments:

GoogleCodeExporter commented 8 years ago
Okay when reading your time values, try to retrieve the raw value instead, 
which is decimal (i.e. 0.5 = 12:00, as 1 = 24 hours).

echo date('H:i:s', $file->raw($i, 'B') * 86400 + mktime(0, 0, 0)) // replace $i 
with row number

Original comment by endar...@gmail.com on 6 Feb 2012 at 11:03

GoogleCodeExporter commented 8 years ago
I am also experiencing similar kind of issue; in my case everything works fine 
on local server but when I move it to production every time format is changed 
to 19:00

Original comment by tejas9...@gmail.com on 14 Dec 2012 at 6:31

GoogleCodeExporter commented 8 years ago
We have tried the above mentioned solution, but it doesn't seem to work as the 
excel sheet already has data in H:i:s format.

Original comment by tejas9...@gmail.com on 14 Dec 2012 at 1:36