Jump to content

Recommended Posts

The mysql STR_TO_DATE() function can produce a DATETIME value from any other data/time format.

 

Your use of YYYY/MM/DD should have worked, depending on if the MM/DD had leading zero's and what your code actually was doing.

I've imported the csv file using import on phpmyadmin but the dates are showing in zero's.

 

Despite formating the dates correctly in excel, csv insists on formatting the date as 4/13/2010  12:00:00 AM.

 

How do I correct this?

Found a quirky solution:

http://forums.devshed.com/mysql-help-4/import-csv-date-to-mysql-673242.html

 

Apparently, each time the csv file is open, the format of the date is reset. In other words, once the csv file is saved from excel, it can't be opened in excel prior to uploading it.

 

I'm just glad to find the solution. I'd never have guessing that thiswas the issue.  :o

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.