Page 1 of 1

Converting string to date

Posted: Tue Jan 10, 2006 10:52 am
by utahfriend
I am using PHP with Mysql. I have a string that I want to store in a date field in MySql. I can get the text in the format (YYYY-mm-dd) but how do I convert it so it will store in the date field?

Thanks

Posted: Tue Jan 10, 2006 1:58 pm
by feyd
as long as you give it to mysql in their date format there's nothing to do. Just remember to give it as a string (quoted) or you'll ask MySQL to store the result of some math ;)