Reading time and dates from an Excel 2007 file

Topics: User Forum
Feb 12, 2013 at 10:25 AM
Edited Feb 12, 2013 at 10:31 AM

I've been trying to read some dates and times from a excel 2007 file, so I can parse it to an iCalender output. And I was wondering if it is possible to get nicer time format out of PHPExcel.

Time example :
One of the time outputs I get is 0.83333333333333 which should represent 20:00 on a 24hour clock.
I figured out an math formula that converts it back to a 24hour clock (0.83333333333333 * 0.24) * 100.

Date example :
One of the date outputs I get is 41382, which should represent 4/18/2013 (MM-DD-YYYY), but for that one I still have to figure out an math formula.

But are there any settings to have a more friendly ouput ? Or an different kind of output ?


[Edit]I meant an excel 2007 file[/edit]
Feb 12, 2013 at 11:03 AM
Rather than try to work it all out for yourself, why not take a look at the built-in conversion functions in PHPExcel_Shared_Date
Feb 12, 2013 at 11:05 AM
Thx for the tip! I will look into it.