frank astin
frank astin

Reputation: 145

Excel file saves date in unknown format

I am importing some an excel file into PHP, and it is returning a field which in excel is displayed as '00:57:48' but when i look in the excel zip it is displayed as '1.4965277777777779E-2' can someone explain to me which format this is and how i can convert it back to the original.

Thanks

Upvotes: 0

Views: 153

Answers (1)

Gabor
Gabor

Reputation: 695

Excel stores date and time values as floating point numbers, based on the number of days that have passed since January 1, 1900.

Whenever you store a single time value (like 00:57:48), it is stored as a float and converted to a proper display format when it is acutally displayed. You can play around with that when you enter a time value into a cell, and then explicitly change the formatting of that cell to a number or vice versa.

What I'm wondering about is that 00:57:48 does not correspond to '1.4965277777777779E-2', so this is a bit strange indeed. Based on the normal calculation logic 00:57:48 should be 4,01388889E-02.

Upvotes: 1

Related Questions