Forum Moderators: coopster

Message Too Old, No Replies

Date format conflict

         

sfast

7:17 pm on Oct 4, 2007 (gmt 0)

10+ Year Member



I have a excel file that has birthdays in the format - 10/22/2002
MM/DD/YYYY

When I import the file, no birthdate gets inserted. I guess the reason being, the dates should be in the format - 10-22-2002.

Is there any way to recognize the above format and the rows gets inserted.

PHP_Chimp

9:51 pm on Oct 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How are you importing the file?
What are you importing the file into? A database or another file.

The separator between numbers in the date is unlikely to be the issue. Im guessing that the problem is that whatever you are importing the data into is set with the data format YYYY/MM/DD, so it is not recognising your MM/DD/YYYY. However without knowing the answer to the questions above im only guessing :)

You may be able to use the date [uk.php.net] and time [uk.php.net] functions to be able to get your date in the correct format.

sfast

10:08 pm on Oct 4, 2007 (gmt 0)

10+ Year Member



Sorry for confusion.

I am trying to import the birthday dates to a table in MYSQL. But the birthday dates colum doesnt get inserted.

What I am looking for is is there any way while importing the excel file to a MySQL table, the column in the table recognizes the MM/DD/YYYY and store it as YYYY-MM -DD

eelixduppy

11:08 pm on Oct 4, 2007 (gmt 0)



Why not just change the date format of the excel file? It should be no more than a few clicks :)

mooger35

3:12 pm on Oct 5, 2007 (gmt 0)

10+ Year Member



In excel (Office 2003):

1. go to format cells

2. Make sure category is "Date"

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

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