Forum Moderators: coopster

Message Too Old, No Replies

excel dates in mysql db

         

ayushchd

2:39 pm on Oct 23, 2007 (gmt 0)

10+ Year Member



I am reading an excel file and inserting the data into db.

But I am facing problem with the date column.

The format of the cell is set to dd-mm-yyyy

So when I echo, if the date is 17-07-2007 it says 39280. What should I do?
How can I convert 17-07-2007 into a Unix timestamp?

mooger35

2:50 pm on Oct 23, 2007 (gmt 0)

10+ Year Member



You can change the format in excel to the correct yyyy-mm-dd format by:

1. Highlight cells containing date

2. go to format on the menu and click cells

3. Make sure category is "Date"

4. Switch "locale (location)" to "English (Canada)"

5. YYYY-MM-DD is now the fourth option (ex. 2001-03-14).