I was trying to import a CSV file to my phpmyadmin
. Then my date field had values as 0000-00-00
since both date formats were different. I changed the CSV date-format to the format in the database. I have 5000+ data in my CSV. but only a few dates change to the format I chose. Remaining still in the old format
I went to Format cells
, selected date, changed to Uk and selected the desired date format. But only a few dates change to the format I chose. Remaining still in the old format
2
Answers
Starting with data like:
Select the cells you wish to convert and run this:
to produce:
You can only change the date format in Excel once Excel recognizes the cell contents as dates. If this doesn’t happen automatically, you can force it with the Text to columns function. After the dates have been recognized, you can use any date format you like.
Select the column with the unrecognised dates, and go to Data tab, click Text to columns.
Select Delimited, Next, Untick everything, Next, Select Date and from the dropdown select the order in which the dates currently are in your column. Hit Finish.
In my example dates are in yyyy-dd-mm format.
This is the fastest way I know of in Excel to make it recognize dates in any order.