Reputation: 12034
My excel sheet has the following format : dd/mm/YYYY
ex: 24/10/2010 (european format)
and my mysql needs: YYYY-mm-dd (US format)
How can I format the date in Excel to have this US format ? I tried with cell format, but I don't have the desired format
Regards
Upvotes: 14
Views: 32659
Reputation: 3664
For the hours, minutes and second
go in the custom category and enter this :
yyyy-mm-dd hh:mm:ss
Upvotes: 17
Reputation: 171
There are many solutions, but I reformat the dates for mysql using this formula (assuming your date is in cell E2):
=YEAR(E2)&"-"&RIGHT(TRIM(100+MONTH(E2)),2)&"-"&RIGHT(TRIM(100+DAY(E2)),2)
Upvotes: 0
Reputation: 9180
Use the text function -- assuming that the date to be converted was in cell A1, =TEXT(A1,"YYYYMMDD") will get your data into a format that mysql will understand as a date.
Upvotes: 7
Reputation: 1056
Here's how you can find this Number format in Excel:
Hope that helps!
Upvotes: 17