Page 1 of 1

Importing dates from CSV

Posted: Mon Sep 15, 2003 11:30 am
by JayBird
I have a CSV file where one column has a date in the format DD/MM/YY.

When i import this into a tinyblob field, it becomes YYYY-MM-DD HH:MM:SS.

How can i store it in the original format?

Im not bothered if it is actually seen as a date, i just need to grab it as a string in my PHP code.

Thanks

Mark

Posted: Mon Sep 15, 2003 1:34 pm
by JAM
That was very wierd.
How do you read the CVS? I mean, where might the conversion string->datetime happen?

On a personal note, I'd use varchar(8) as the field as the size never would be less or more. Saves a couple of bytes...

Posted: Mon Sep 15, 2003 2:57 pm
by JayBird
I am using the GUI SQLyog to import the CSV.

I have set the colum to varchar, but i will try the length of 8 when i am at work tomorrow.

Mark

Posted: Mon Sep 15, 2003 3:12 pm
by JAM
Aha, using 3rd part software.
If you still experience problems, try using phpMyAdmin or MySQL-Front (GUI software) that also supports CVS's.
Perhaps it's an issue in the software. Just thoughts...