I am trying to upload an excel spreadsheet with a column that contains dates and also other text.
the date is in the format 1/24/2012 but when i load it into mysql it changes it to some decimal format e.g. 40932 ????
how can i just upload it as is, without it changing? o
What can i do i’m really stuck on this one!!!!
Any help would be most appreciated.
Excel holds date values as the “real” number of days since a base date, which can be either 1st January 1900 (the default for Windows versions of Excel) or 1st January 1904 (the default for Mac versions of Excel): the time is the fractional part, so midday on any given date is 0.5 greater than midnight. To add to the misery, Feb29th 1900 is a valid date for the Windows 1900 calendar.
Assuming the Windows 1900 calendar:
if Mac 1904 base, replace
with
This will return a PHP date/time value (standard 1970 base date), that you can then format as you wish using date();